i'm doing a mocked test that waits until something finishes. the problem is
,that i can't run the 2nd method as it waits for the first one somehow.
public interface ITest
{
void T1();
void T2();
}
the problem is in calling T2() - it waits for T1 to end. i don't understand
why
[Test]
public void TestThread()
{
ITest t = MockRepository.GenerateMock<ITest>();
t.Stub(t1 => t1.T1()).WhenCalled((mi) =>
{
Thread.Sleep(10000);
});
t.Stub(t1 => t1.T2()).WhenCalled((mi) =>
{
// something
});
Task<string> task = Task.Factory.StartNew<string>(() =>
{
t.T1();
return "";
});
Thread.Sleep(1000);
t.T2(); // This hangs until T1 is finished!
}
Anyone encountered this?
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rhinomocks.
For more options, visit https://groups.google.com/d/optout.