예제 #1
0
        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();
        }
예제 #2
0
        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();
        }