Exemplo n.º 1
0
        public void ATemplateContoller_Delete()
        {
            ATemplateController _controller = new ATemplateController(_mockService.Object, _logger.Object);

            var result = _controller.Delete(1);

            Assert.IsNotNull(result);
        }
Exemplo n.º 2
0
        public void ATemplateContoller_Delete_ReturnsBadRequestOnException()
        {
            _mockService.Setup(m => m.Remove(It.IsAny <int>())).Throws(new System.Exception("Test Exception"));
            ATemplateController _controller = new ATemplateController(_mockService.Object, _logger.Object);

            var result = _controller.Delete(1);

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