public async void Create_No_Errors() { SalesTaxRateControllerMockFacade mock = new SalesTaxRateControllerMockFacade(); var mockResponse = new CreateResponse <ApiSalesTaxRateResponseModel>(new FluentValidation.Results.ValidationResult()); mockResponse.SetRecord(new ApiSalesTaxRateResponseModel()); mock.ServiceMock.Setup(x => x.Create(It.IsAny <ApiSalesTaxRateRequestModel>())).Returns(Task.FromResult <CreateResponse <ApiSalesTaxRateResponseModel> >(mockResponse)); SalesTaxRateController controller = new SalesTaxRateController(mock.ApiSettingsMoc.Object, mock.LoggerMock.Object, mock.TransactionCoordinatorMock.Object, mock.ServiceMock.Object, mock.ModelMapperMock.Object); controller.ControllerContext = new ControllerContext(); controller.ControllerContext.HttpContext = new DefaultHttpContext(); IActionResult response = await controller.Create(new ApiSalesTaxRateRequestModel()); response.Should().BeOfType <CreatedResult>(); (response as CreatedResult).StatusCode.Should().Be((int)HttpStatusCode.Created); var createResponse = (response as CreatedResult).Value as CreateResponse <ApiSalesTaxRateResponseModel>; createResponse.Record.Should().NotBeNull(); mock.ServiceMock.Verify(x => x.Create(It.IsAny <ApiSalesTaxRateRequestModel>())); }