I used the Moq framework in C # for bullying in unit tests, but there is one thing that I haven't figured out yet. I have this line of code
var feedParserMock = new Mock<ApplicationServices.IFeedParser>();
feedParserMock.Setup(y => y.ParseFeed(csv)).Returns(items).Verifiable();
In the second line, does this mean that it will return a value only if the passed parameter is the same? because the parameter that I pass ParseFeed inside my controller is built into the controller and I do not have access to it in the unit test. Currently the method returns null, is there any way to indicate that I want to return the variable my items no matter what the parameter is?
source
share