I want to be able to arrange the return value of `new` expressions, like Mock.Arrange(() => new FileInfo()).Returns(mockFileInfo).
Then, I expect that `new FileInfo()` will always return my mock instance.
3 comments
Nacho
Posted on:29 Apr 2014 12:26
Stefan,you are right, then the new FileInfo()).Returns(mockFileInfo) construction should allow the usage of the InSequence call.
Regards.
Stefan
Posted on:29 Apr 2014 12:15
Is .InSequence() what you're looking for? http://www.telerik.bg/help/justmock/basic-usage-sequential-mocking.html
Nacho
Posted on:23 Apr 2014 16:33
What would be really nice is to be able to specify what to return each time is called, something like:
Mock.Arrange(() => new FileInfo()).Returns(mockFileInfo).FirstTime();
Mock.Arrange(() => new FileInfo()).Returns(otherMockFileInfo).TimeCalled(2);