public async Task AsExpectedResultWhenModalIsInvalid(String status) { var mockService = new Mock <ICosmosDatabaseService>(); var controller = new BankControllor(mockService.Object); var actual = await controller.Put("MC163868", status) as BadRequestObjectResult; Assert.AreEqual(StatusCodes.Status400BadRequest, actual.StatusCode); Assert.AreEqual("Please check the statusType", actual.Value); }
public async Task AsExpectedResultWhenModalIsValid() { var mockService = new Mock <ICosmosDatabaseService>(); mockService.Setup(x => x.UpdateCustomerDetails(It.IsAny <string>(), It.IsAny <string>())).Returns(Task.FromResult(true)); var controller = new BankControllor(mockService.Object); var actual = await controller.Put("MC121414", StatusType.Served) as OkResult; Assert.AreEqual(StatusCodes.Status200OK, actual.StatusCode); }