예제 #1
0
        public async Task GetAsync_Error()
        {
            var error                 = ErrorTransferData.ErrorBadRequest;
            var resultTests           = new ResultCollection <TestTransfer>(error);
            var restClient            = RestClientMock.GetRestClient(resultTests);
            var testTransferConverter = TestTransferConverter;
            var testRestService       = new TestRestService(restClient.Object, testTransferConverter);

            var result = await testRestService.GetAsync();

            Assert.True(result.HasErrors);
            Assert.True(result.Errors.First().ErrorResultType == ErrorResultType.BadRequest);
        }
예제 #2
0
        public async Task GetByIdAsync_Ok()
        {
            var test                  = TestTransferData.TestTransfers.First();
            var resultTest            = new ResultValue <TestTransfer>(test);
            var restClient            = RestClientMock.GetRestClient(resultTest);
            var testTransferConverter = TestTransferConverter;
            var testRestService       = new TestRestService(restClient.Object, testTransferConverter);

            var result = await testRestService.GetAsync(test.Id);

            Assert.True(result.OkStatus);
            Assert.True(TestData.TestDomains.First().Equals(result.Value));
        }
예제 #3
0
        public async Task GetAsync_Ok()
        {
            var tests                 = TestTransferData.TestTransfers;
            var resultTests           = new ResultCollection <TestTransfer>(tests);
            var restClient            = RestClientMock.GetRestClient(resultTests);
            var testTransferConverter = TestTransferConverter;
            var testRestService       = new TestRestService(restClient.Object, testTransferConverter);

            var result = await testRestService.GetAsync();

            Assert.True(result.OkStatus);
            Assert.True(TestData.TestDomains.SequenceEqual(result.Value));
        }