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

            var client = new ApiClient(testServer.CreateClient());
            ApiBusinessEntityResponseModel response = await client.BusinessEntityGetAsync(1);

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

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <BusinessEntity>(null));
            var service = new BusinessEntityService(mock.LoggerMock.Object,
                                                    mock.RepositoryMock.Object,
                                                    mock.ModelValidatorMockFactory.BusinessEntityModelValidatorMock.Object,
                                                    mock.BOLMapperMockFactory.BOLBusinessEntityMapperMock,
                                                    mock.DALMapperMockFactory.DALBusinessEntityMapperMock,
                                                    mock.BOLMapperMockFactory.BOLBusinessEntityAddressMapperMock,
                                                    mock.DALMapperMockFactory.DALBusinessEntityAddressMapperMock,
                                                    mock.BOLMapperMockFactory.BOLBusinessEntityContactMapperMock,
                                                    mock.DALMapperMockFactory.DALBusinessEntityContactMapperMock,
                                                    mock.BOLMapperMockFactory.BOLPersonMapperMock,
                                                    mock.DALMapperMockFactory.DALPersonMapperMock);

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

            response.Should().BeNull();
            mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>()));
        }
Esempio n. 3
0
        public async void TestGet()
        {
            ApiBusinessEntityResponseModel response = await this.Client.BusinessEntityGetAsync(1);

            response.Should().NotBeNull();
        }