コード例 #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());
            ApiWorkOrderRoutingResponseModel response = await client.WorkOrderRoutingGetAsync(1);

            response.Should().NotBeNull();
        }
コード例 #2
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IWorkOrderRoutingRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <WorkOrderRouting>(null));
            var service = new WorkOrderRoutingService(mock.LoggerMock.Object,
                                                      mock.RepositoryMock.Object,
                                                      mock.ModelValidatorMockFactory.WorkOrderRoutingModelValidatorMock.Object,
                                                      mock.BOLMapperMockFactory.BOLWorkOrderRoutingMapperMock,
                                                      mock.DALMapperMockFactory.DALWorkOrderRoutingMapperMock);

            ApiWorkOrderRoutingResponseModel response = await service.Get(default(int));

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
コード例 #3
0
        public async void TestGet()
        {
            ApiWorkOrderRoutingResponseModel response = await this.Client.WorkOrderRoutingGetAsync(1);

            response.Should().NotBeNull();
        }