public async void Get() { var mock = new ServiceMockFacade <ISalesPersonRepository>(); var record = new SalesPerson(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult(record)); var service = new SalesPersonService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.SalesPersonModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLSalesPersonMapperMock, mock.DALMapperMockFactory.DALSalesPersonMapperMock, mock.BOLMapperMockFactory.BOLSalesOrderHeaderMapperMock, mock.DALMapperMockFactory.DALSalesOrderHeaderMapperMock, mock.BOLMapperMockFactory.BOLSalesPersonQuotaHistoryMapperMock, mock.DALMapperMockFactory.DALSalesPersonQuotaHistoryMapperMock, mock.BOLMapperMockFactory.BOLSalesTerritoryHistoryMapperMock, mock.DALMapperMockFactory.DALSalesTerritoryHistoryMapperMock, mock.BOLMapperMockFactory.BOLStoreMapperMock, mock.DALMapperMockFactory.DALStoreMapperMock); ApiSalesPersonResponseModel response = await service.Get(default(int)); response.Should().NotBeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>())); }
public async void TestGet() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiSalesPersonResponseModel response = await client.SalesPersonGetAsync(1); response.Should().NotBeNull(); }
public async void TestGet() { ApiSalesPersonResponseModel response = await this.Client.SalesPersonGetAsync(1); response.Should().NotBeNull(); }