Hello,
I have the following code:
As you can see I have an out parameter, I have not figure out how to mock virtualCount, what I did is created a variable in my test method which I do not like. Can you provide an example of how to do that?
Also, if you can provide an example how to mock a ref parameter as well please?
Also, how can Mock a delegate that I pass into method under test, right now I create a method in my test class that matches the delegate signature and pass that across, is there a better option?
I am using 2013.2.701.0 version.
I have the following code:
var mockDocumentRepository = Mock.Create<
IDocumentRepository
>();
Mock.Arrange(() => mockDocumentRepository.FetchDocumentsByListCriteria(Arg.IsAny<
ListCriteria
>(), Arg.AnyInt, Arg.AnyInt, out virtualCount)).Returns(GetFakeDocumentListWithChildren_OneChildLevel());
As you can see I have an out parameter, I have not figure out how to mock virtualCount, what I did is created a variable in my test method which I do not like. Can you provide an example of how to do that?
Also, if you can provide an example how to mock a ref parameter as well please?
Also, how can Mock a delegate that I pass into method under test, right now I create a method in my test class that matches the delegate signature and pass that across, is there a better option?
I am using 2013.2.701.0 version.