Example #1
0
        public void NullStringPutReturnsBadRequestObject()
        {
            var helloController = new HelloController(Mock.Of <IBirthdayRepository>(), Mock.Of <IBirthdayCalculator>());

            var putResult = helloController.Put(null, validDateOfBirth);

            Assert.IsType <BadRequestObjectResult>(putResult);
        }
Example #2
0
        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
        }
Example #4
0
        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);
        }