public async void TestGet() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiSalesTaxRateResponseModel response = await client.SalesTaxRateGetAsync(1); response.Should().NotBeNull(); }
public async void Get_null_record() { var mock = new ServiceMockFacade <ISalesTaxRateRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <SalesTaxRate>(null)); var service = new SalesTaxRateService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.SalesTaxRateModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLSalesTaxRateMapperMock, mock.DALMapperMockFactory.DALSalesTaxRateMapperMock); ApiSalesTaxRateResponseModel response = await service.Get(default(int)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>())); }
public async void ByStateProvinceIDTaxType_Exists() { var mock = new ServiceMockFacade <ISalesTaxRateRepository>(); var record = new SalesTaxRate(); mock.RepositoryMock.Setup(x => x.ByStateProvinceIDTaxType(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(record)); var service = new SalesTaxRateService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.SalesTaxRateModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLSalesTaxRateMapperMock, mock.DALMapperMockFactory.DALSalesTaxRateMapperMock); ApiSalesTaxRateResponseModel response = await service.ByStateProvinceIDTaxType(default(int), default(int)); response.Should().NotBeNull(); mock.RepositoryMock.Verify(x => x.ByStateProvinceIDTaxType(It.IsAny <int>(), It.IsAny <int>())); }
public async void TestGet() { ApiSalesTaxRateResponseModel response = await this.Client.SalesTaxRateGetAsync(1); response.Should().NotBeNull(); }