常用方法
常用方法
常用方法
常用方法
public void GetEntitiesReturnsCalled() { //Setup var mService = new Mock <IClassService>(); mService.Setup(mock => mock.GetEntities(It.IsAny <int>(), It.IsAny <int>())); //Action var controller = new ClassController(mService.Object); controller.GetEntities(It.IsAny <int>(), It.IsAny <int>()); //Assert mService.Verify(mock => mock.GetEntities(It.IsAny <int>(), It.IsAny <int>()), Times.Once); }