Geeks With Blogs
Abhishek Anand Bits & Bytes about .net technology framework. mocking
Moq – Return a Parameter
Moq provides an additional overload for the Returns method that takes a lambda expression with the same parameters as the method signature. When this overload is used, Moq will inject the parameters passed to the Setup method into the Returns as its lambda expression parameters. Note: The parameters for the lambda expression must match up in both number and ordering to the method signature. Example 1: public interface ITestInterface { string SomeMethod(string str); } … mockTestInterface.Setup(i => ......

Posted On Monday, November 18, 2013 6:27 PM

Copyright © Abhishek Anand | Powered by: