Exemplo n.º 1
0
        public async Task ThenIShouldGetTotalsByCourseForSFACoInvestmentPayments()
        {
            //Arrange
            var payment1 = new PaymentTransactionLine {
                CourseName = "Test Course", SfaCoInvestmentAmount = 100, TransactionType = TransactionItemType.Payment
            };
            var payment2 = new PaymentTransactionLine {
                CourseName = "Test Course", SfaCoInvestmentAmount = 50, TransactionType = TransactionItemType.Payment
            };
            var expectedTotal = payment1.SfaCoInvestmentAmount + payment2.SfaCoInvestmentAmount;

            _response = new FindAccountProviderPaymentsResponse
            {
                ProviderName    = "Test Provider",
                TransactionDate = DateTime.Now,
                Total           = expectedTotal,
                Transactions    = new List <PaymentTransactionLine> {
                    payment1, payment2
                }
            };
            _mediator.Setup(AssertExpressionValidation()).ReturnsAsync(_response);

            //Act
            var result = await _orchestrator.GetProviderPaymentSummary(HashedAccountId, ExpectedUkPrn, _fromDate, _toDate, ExternalUser);

            //Assert
            Assert.AreEqual(expectedTotal, result.Data.CoursePayments.First().SFACoInvestmentAmount);
        }
        public void Arrange()
        {
            _accountApiClient = new Mock <IAccountApiClient>();
            _mediator         = new Mock <IMediator>();
            _currentTime      = new Mock <ICurrentDateTime>();
            _hashingService   = new Mock <IHashingService>();

            _response = new FindAccountProviderPaymentsResponse
            {
                ProviderName    = "Test Provider",
                TransactionDate = DateTime.Now,
                Total           = 100,
                Transactions    = new List <PaymentTransactionLine>
                {
                    new PaymentTransactionLine {
                        Amount = 100
                    }
                }
            };

            _mediator.Setup(AssertExpressionValidation()).ReturnsAsync(_response);

            _hashingService.Setup(h => h.DecodeValue(HashedAccountId)).Returns(AccountId);

            _accountApiClient.Setup(s => s.GetAccount(HashedAccountId))
            .Returns(Task.FromResult(new EAS.Account.Api.Types.AccountDetailViewModel
            {
                ApprenticeshipEmployerType = "Levy"
            }));

            _orchestrator =
                new EmployerAccountTransactionsOrchestrator(_accountApiClient.Object, _mediator.Object, _currentTime.Object, Mock.Of <ILog>());
        }
Exemplo n.º 3
0
        public void Arrange()
        {
            _mediator    = new Mock <IMediator>();
            _currentTime = new Mock <ICurrentDateTime>();

            _response = new FindAccountProviderPaymentsResponse
            {
                ProviderName    = "Test Provider",
                TransactionDate = DateTime.Now,
                Total           = 100,
                Transactions    = new List <PaymentTransactionLine>
                {
                    new PaymentTransactionLine {
                        Amount = 100
                    }
                }
            };

            _mediator.Setup(AssertExpressionValidation()).ReturnsAsync(_response);

            _orchestrator = new EmployerAccountTransactionsOrchestrator(_mediator.Object, _currentTime.Object);
        }