public void RecurringTransactionWithoutQuantityShouldHaveFutureTransactionDependingOnPeriodicityForOneYear(Periodicity periodicity, int assertCount) { var rT = new RecurringTransactionFactory().WithCreditDefaultValues().WithPeriodicity(periodicity).WithStartDate(DateTime.Today.AddDays(-1)).WithCurrency(new Currency()).Build(); var future = rT.GetFutureTransaction(); future.Should().HaveCount(assertCount); }
public void RecurringTransactionWithQuantityOneShouldHaveOneFutureTransaction() { var rT = new RecurringTransactionFactory().WithCreditDefaultValues().WithQuantity(1).WithCurrency(new Currency()).Build(); var futureTransactions = rT.GetFutureTransaction(); futureTransactions.Should().HaveCount(1); }
public void RecurringTransactionWithTransactionRegisteredOnCurrentPeriodShouldReturnOnlyFuture(Periodicity periodicity, int assertCount) { var passedTransactionDate = DateTime.Today; var recurStartDate = DateTime.Today.AddDays(-1); var rT = new RecurringTransactionFactory().WithCreditDefaultValues().WithPeriodicity(periodicity).WithStartDate(recurStartDate).WithCurrency(new Currency()).WithPassedTransactionOn(passedTransactionDate).Build(); var future = rT.GetFutureTransaction(); var dates = GetLimitDates(periodicity, passedTransactionDate); future.Should().HaveCount(assertCount); future.Where(f => dates.Item1 < f.Date && f.Date < dates.Item2).Should().BeEmpty(); }