public void ATemplateContoller_GetOne() { ATemplateController _controller = new ATemplateController(_mockService.Object, _logger.Object); var result = _controller.Get(1); Assert.IsNotNull(result); }
public void ATemplateContoller_GetOne_ReturnsBadRequestOnException() { _mockService.Setup(m => m.GetById(It.IsAny <int>())).Throws(new System.Exception("Test Exception")); ATemplateController _controller = new ATemplateController(_mockService.Object, _logger.Object); var result = _controller.Get(1); Assert.IsTrue(result.Result is BadRequestObjectResult); }