public async void TestGet()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());
            ApiWorkOrderResponseModel response = await client.WorkOrderGetAsync(1);

            response.Should().NotBeNull();
        }
Exemplo n.º 2
0
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <IWorkOrderRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <WorkOrder>(null));
            var service = new WorkOrderService(mock.LoggerMock.Object,
                                               mock.RepositoryMock.Object,
                                               mock.ModelValidatorMockFactory.WorkOrderModelValidatorMock.Object,
                                               mock.BOLMapperMockFactory.BOLWorkOrderMapperMock,
                                               mock.DALMapperMockFactory.DALWorkOrderMapperMock,
                                               mock.BOLMapperMockFactory.BOLWorkOrderRoutingMapperMock,
                                               mock.DALMapperMockFactory.DALWorkOrderRoutingMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
        public async void TestGet()
        {
            ApiWorkOrderResponseModel response = await this.Client.WorkOrderGetAsync(1);

            response.Should().NotBeNull();
        }