public void CreateEntityReturnsCalled() { //Setup var mService = new Mock <IClassService>(); mService.Setup(mock => mock.CreateEntity(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <ClassDTO>())); //Action var controller = new ClassController(mService.Object); controller.CreateEntity(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <ClassDTO>()); //Assert mService.Verify(mock => mock.CreateEntity(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <ClassDTO>()), Times.Once); }