Example #1
0
        public void ATemplateContoller_Put()
        {
            ATemplateController _controller = new ATemplateController(_mockService.Object, _logger.Object);

            ATemplateViewModel application = new ATemplateViewModel()
            {
                Id = 99
            };

            var result = _controller.Put(99, application);

            Assert.IsNotNull(result);
        }
Example #2
0
        public void ATemplateContoller_Put_ReturnsBadRequestOnException()
        {
            _mockService.Setup(m => m.Update(It.IsAny <ATemplateViewModel>())).Throws(new System.Exception("Test Exception"));
            ATemplateController _controller = new ATemplateController(_mockService.Object, _logger.Object);

            ATemplateViewModel application = new ATemplateViewModel()
            {
                Id = 1
            };

            var result = _controller.Put(1, application);

            Assert.IsTrue(result.Result is BadRequestObjectResult);
        }