public async void TestGet() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiSalesOrderDetailResponseModel response = await client.SalesOrderDetailGetAsync(1); response.Should().NotBeNull(); }
public async void Get_null_record() { var mock = new ServiceMockFacade <ISalesOrderDetailRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <SalesOrderDetail>(null)); var service = new SalesOrderDetailService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.SalesOrderDetailModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLSalesOrderDetailMapperMock, mock.DALMapperMockFactory.DALSalesOrderDetailMapperMock); ApiSalesOrderDetailResponseModel response = await service.Get(default(int)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>())); }
public async void TestGet() { ApiSalesOrderDetailResponseModel response = await this.Client.SalesOrderDetailGetAsync(1); response.Should().NotBeNull(); }