public async void TestGet() { var builder = new WebHostBuilder() .UseEnvironment("Production") .UseStartup <TestStartup>(); TestServer testServer = new TestServer(builder); var client = new ApiClient(testServer.CreateClient()); ApiProductDescriptionResponseModel response = await client.ProductDescriptionGetAsync(1); response.Should().NotBeNull(); }
public async void Get_null_record() { var mock = new ServiceMockFacade <IProductDescriptionRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <ProductDescription>(null)); var service = new ProductDescriptionService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.ProductDescriptionModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLProductDescriptionMapperMock, mock.DALMapperMockFactory.DALProductDescriptionMapperMock, mock.BOLMapperMockFactory.BOLProductModelProductDescriptionCultureMapperMock, mock.DALMapperMockFactory.DALProductModelProductDescriptionCultureMapperMock); ApiProductDescriptionResponseModel response = await service.Get(default(int)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>())); }
public async void TestGet() { ApiProductDescriptionResponseModel response = await this.Client.ProductDescriptionGetAsync(1); response.Should().NotBeNull(); }