Example #1
0
        public async Task AndTheAccountHasALevyOverrideThenTheyShouldNotBeAllowedPaymentOnTheService()
        {
            _expectedAccountBalance.LevyOverride = false;

            var response = await _orchestrator.GetAllAccountsWithBalances(DateTime.Now.ToString(), 10, 1);

            Assert.IsFalse(response.Data.Data.First().IsAllowedPaymentOnService);
        }
Example #2
0
        public async Task <IHttpActionResult> GetAccounts(string toDate = null, int pageSize = 1000, int pageNumber = 1)
        {
            var result = await _orchestrator.GetAllAccountsWithBalances(toDate, pageSize, pageNumber);

            if (result.Status == HttpStatusCode.OK)
            {
                result.Data.Data.ForEach(x => x.Href = Url.Route("GetAccount", new { hashedAccountId = x.AccountHashId }));
                return(Ok(result.Data));
            }

            return(Conflict());
        }
Example #3
0
        public async Task ThenShouldReturnAllAccountsWithBalances()
        {
            var result = await _orchestrator.GetAllAccountsWithBalances(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>());

            result.Should().NotBeNull();
            result.Data.ShouldBeEquivalentTo(new PagedApiResponseViewModel <AccountWithBalanceViewModel>
            {
                TotalPages = 123,
                Page       = 123,
                Data       = new List <AccountWithBalanceViewModel>
                {
                    new AccountWithBalanceViewModel {
                        AccountHashId = "ABC123", AccountId = 123, AccountName = "Test 1", Balance = 20, IsLevyPayer = true, StartingTransferAllowance = 10, TransferAllowance = 20
                    },
                    new AccountWithBalanceViewModel {
                        AccountHashId = "ABC999", AccountId = 987, AccountName = "Test 2", Balance = 200, IsLevyPayer = true, StartingTransferAllowance = 100, TransferAllowance = 200
                    }
                }
            });
        }