moq only one method in a class
问题 I'm using moq.dll When I mock a class(all the IRepository interface) i use this line code int state = 5; var rep = new Mock<IRepository>(); rep.Setup(x => x.SaveState(state)).Returns(true); IRepository repository = rep.Object; but in this case i mock all the function in repository class. Then all the methods in class repository are substituted with the methods setup of Mock dll I want use all the methods defined in class repository(the real class) and mock only one function(SaveState) How can