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(); }
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>())); }
public async void TestGet() { ApiWorkOrderRoutingResponseModel response = await this.Client.WorkOrderRoutingGetAsync(1); response.Should().NotBeNull(); }