public void Get_ResturnsNotFound() { long customerID = 1; string email = "*****@*****.**"; InquiryView serviceResult = null; inquiryServiceMock.Setup(x => x.GetByCustomerID(1)).ReturnsAsync(serviceResult); InquiryController controller = new InquiryController(inquiryServiceMock.Object); var responce = controller.Get(customerID, email).Result; var objectResponse = responce as NotFoundResult; Assert.IsInstanceOf <NotFoundResult>(responce); }
public void Get_ResturnsBadRequest() { long? customerID = null; string email = null; InquiryView serviceResult = null; inquiryServiceMock.Setup(x => x.GetByCustomerID(1)).ReturnsAsync(serviceResult); InquiryController controller = new InquiryController(inquiryServiceMock.Object); var responce = controller.Get(customerID, email).Result; var objectResponse = responce as BadRequestObjectResult; Assert.IsInstanceOf <BadRequestObjectResult>(responce); }
public void Get_ResturnsInquiryView() { long customerID = 1; string email = "*****@*****.**"; InquiryView serviceResult = new InquiryView { CustomerID = customerID }; inquiryServiceMock.Setup(x => x.GetByCustomerID(1)).ReturnsAsync(serviceResult); InquiryController controller = new InquiryController(inquiryServiceMock.Object); var responce = controller.Get(customerID, email).Result; var objectResponse = responce as OkObjectResult; Assert.IsInstanceOf <OkObjectResult>(responce); Assert.AreEqual(serviceResult, objectResponse.Value); }