public void NullStringPutReturnsBadRequestObject() { var helloController = new HelloController(Mock.Of <IBirthdayRepository>(), Mock.Of <IBirthdayCalculator>()); var putResult = helloController.Put(null, validDateOfBirth); Assert.IsType <BadRequestObjectResult>(putResult); }
public void SuccessfulPutReturnsNoContent() { var helloController = new HelloController(Mock.Of <IBirthdayRepository>(), Mock.Of <IBirthdayCalculator>()); var putResult = helloController.Put(validName, validDateOfBirth); Assert.IsType <NoContentResult>(putResult); }
public void Put() { // Arrange var controller = new HelloController(); // Act controller.Put(5, "value"); // Assert }
public void FutureDatePutReturnsBadRequestObject() { var helloController = new HelloController(Mock.Of <IBirthdayRepository>(), Mock.Of <IBirthdayCalculator>()); var tomorrowsDate = new DateOfBirth { dateOfBirth = DateTime.Today.AddDays(1) }; var putResult = helloController.Put(validName, tomorrowsDate); Assert.IsType <BadRequestObjectResult>(putResult); }