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

            var client = new ApiClient(testServer.CreateClient());
            ApiTransactionHistoryArchiveResponseModel response = await client.TransactionHistoryArchiveGetAsync(1);

            response.Should().NotBeNull();
        }
        public async void Get_null_record()
        {
            var mock = new ServiceMockFacade <ITransactionHistoryArchiveRepository>();

            mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <TransactionHistoryArchive>(null));
            var service = new TransactionHistoryArchiveService(mock.LoggerMock.Object,
                                                               mock.RepositoryMock.Object,
                                                               mock.ModelValidatorMockFactory.TransactionHistoryArchiveModelValidatorMock.Object,
                                                               mock.BOLMapperMockFactory.BOLTransactionHistoryArchiveMapperMock,
                                                               mock.DALMapperMockFactory.DALTransactionHistoryArchiveMapperMock);

            ApiTransactionHistoryArchiveResponseModel 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()
        {
            ApiTransactionHistoryArchiveResponseModel response = await this.Client.TransactionHistoryArchiveGetAsync(1);

            response.Should().NotBeNull();
        }