samedi 4 juillet 2015

C# Mock method return value evaluate at the actual execution

I'm using Nunit testing with Rhino-Mocks for my code unit testing.
My code is like below;

_mockHandler.Expect(m => m.DoSomething(Arg<string>.Is.Anything, Arg<string>.Is.Anything))
            .Return(myList["XXX"]);

Content of the myList is updating from a thread running. Once the above line executing value of myList["XXX"] is empty. But at the time of this method invoke from the code myList["XXX"] is having a value.

Is there any way to configure, refer to the actual value when calling the method?

Aucun commentaire:

Enregistrer un commentaire