Example #1
0
 public void ThenTheForecastingPaymentServiceShouldStoreTheStoppedCommitment()
 {
     WaitForIt(() =>
     {
         return(Payments.All(payment => DataContext.Commitments.Any(c =>
                                                                    c.EmployerAccountId == Config.EmployerAccountId &&
                                                                    c.ApprenticeshipId == payment.ApprenticeshipId && c.ActualEndDate != null)));
     }, "Failed to find the ended commitment");
 }
Example #2
0
        public void ThenTheForecastingPaymentServiceShouldStoreThePaymentDeclarationsReceivingEmployerFromSendingEmployer(int receivningEmployerId, int sendingEmployerId)
        {
            WaitForIt(() =>
            {
                var payments = DataContext.Payments
                               .Where(m => m.EmployerAccountId == receivningEmployerId &&
                                      m.SendingEmployerAccountId == sendingEmployerId &&
                                      m.FundingSource == FundingSource.Transfer)
                               .ToList();

                var paymentsSaved = Payments.Count(p => payments.Any(expected => expected.ExternalPaymentId == p.PaymentId));
                var msg           = $"{paymentsSaved} of expected {Payments.Count()} Payment found.";

                var pass = Payments.All(p => payments.Any(expected => expected.ExternalPaymentId == p.PaymentId));
                return(Tuple.Create(pass, msg));
            }, $"Failed to find all the payments.");
        }
Example #3
0
 public bool NoRefund()
 {
     return(Payments.All(f => f.Refunds.Count == 0));
 }