public void Delete_Person_Returns_Response_Message_With_No_Content_Status_Code() { // Arrange var service = Mock.Of<IPersonService>(); var controller = new PersonController(service); // Act var result = controller.Delete(ObjectId.GenerateNewId().ToString()) as OkResult; // Assert Assert.NotNull(result); }
public void Delete_Person_Runs_Service_Method() { // Arrange var removedId = ObjectId.GenerateNewId().ToString(); var service = Mock.Of<IPersonService>(); var controller = new PersonController(service); // Act controller.Delete(removedId); // Assert Mock.Get(service).Verify(s => s.Delete(removedId), Times.Once); }