I'm currently attempting to use Rhino Mocks to unit test a workflow we
have created using Workflow Foundation 3.5.

A simplified view of the start of our workflow looks like this:

Sequence
{
  A()
  Parallel
  {
    Sequence
    {
      B()
      C()
    }
    Sequence
    {
      S()
      T()
    }
  }
  D()
}

Because WF executes the contents of parallel statements interleaved,
the valid orders for the method calls here are:

ABCSTD
ABSCTD
ABSTCD
ASTBCD
ASBTCD
ASBCTD

I've chosen the method names here to be the same as in the following
post from 2006, because my problem is essentially the same as his:

http://groups.google.co.uk/group/rhinomocks/browse_thread/thread/e4865d54554a6c09

My attempt at mocking this was the same as the above post:

using ( mocks.Ordered() )
{
  mock1.A();
  using ( mocks.Unordered() )
  {
    using ( mocks.Ordered() )
    {
        mock1.B();
        mock1.C();
    }
    using ( mocks.Ordered() )
    {
        mock1.S();
        mock1.T();
    }
  }
  mock1.D();
}

And the result was the same; that rhino mocks only allows:

ABCSTD
ASTCBD

My workflow in reality contains hundreds of these calls being executed
in sequence and in parallel.  This makes it impractical for me to
anticipate how the Workflow Runtime will order it's parallel
interleaved method calls.

I can't just set everything to be unordered, as that doesn't test the
ordering in any of the sequential blocks.

As far as I know there is no way to stop Workflow Foundation from
interleaving parallel blocks.

Can anyone help with a practical solution to this problem?  Ideally a
way to get Rhino Mocks to allow interleaving of ordered blocks within
an unordered block.

Cheers,
James.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rhinomocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to