Exemple #1
0
        public void GetTransfer_ShouldNotFindTransfer()
        {
            var controller = new SwiftTransfersControllerTest(GetTestTransfers());
            var result     = controller.GetTransfer(999);

            Assert.IsInstanceOfType(result, typeof(NotFoundResult));
        }
Exemple #2
0
        public void GetTransfersFind_ShouldFindTransfers()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = controller.Search("3001", testTransfers);

            Assert.AreEqual(testTransfers[2].holder, result[0].holder);
        }
Exemple #3
0
        public void GetAllTransfers_ShouldReturnAllTransfers()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = controller.GetAllTransfers() as List <SwiftTransfer>;

            Assert.AreEqual(testTransfers.Count, result.Count);
        }
Exemple #4
0
        public async Task GetAllTransfersAsync_ShouldReturnAllTransfers()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = await controller.GetAllTransfersAsync() as List <SwiftTransfer>;

            Assert.AreEqual(testTransfers.Count, result.Count);
        }
Exemple #5
0
        public async Task GetTransferPaginatedAsync_ShouldPaginateTransfer()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = await controller.GetAllTransfersPaginateAsync(1, 4, testTransfers) as List <SwiftTransfer>;

            Assert.AreEqual(testTransfers[4].holder, result[0].holder);
        }
Exemple #6
0
        public void GetTransferPaginated_ShouldPaginateTransfer()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = controller.Paginate(1, 4, testTransfers);

            Assert.AreEqual(testTransfers[4].holder, result[0].holder);
        }
Exemple #7
0
        public async Task GetTransferSortedAsync_ShouldSortTransfer()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = await controller.GetAllTransfersSortAsync("-id", testTransfers) as List <SwiftTransfer>;

            Assert.AreEqual(testTransfers[3].holder, result[1].holder);
        }
Exemple #8
0
        public void GetTransferSorted_ShouldSortTransfer()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = controller.Sort("-id", testTransfers);

            Assert.AreEqual(testTransfers[3].holder, result[1].holder);
        }
Exemple #9
0
        public async Task GetTransfersFindAsync_ShouldFindTransfers()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = await controller.GetAllTransfersFindAsync("3001", testTransfers) as List <SwiftTransfer>;

            Assert.AreEqual(1, result.Count);
        }
Exemple #10
0
        public async Task GetTransferAsync_ShouldReturnCorrectTransfer()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = await controller.GetTransferAsync(930012) as OkNegotiatedContentResult <SwiftTransfer>;

            Assert.IsNotNull(result);
            Assert.AreEqual(testTransfers[2].holder, result.Content.holder);
        }
Exemple #11
0
        public void GetTransfer_ShouldReturnCorrectTransfer()
        {
            var testTransfers = GetTestTransfers();
            var controller    = new SwiftTransfersControllerTest(testTransfers);

            var result = controller.GetTransfer(237912) as OkNegotiatedContentResult <SwiftTransfer>;

            Assert.IsNotNull(result);
            Assert.AreEqual(testTransfers[1].holder, result.Content.holder);
        }