Exemple #1
0
        public void CreateRecurringTransactionsRespectingEndDate()
        {
            List <TransactionLine> lines       = new List <TransactionLine>();
            RecurringTransaction   transaction = TransactionLineBuilder.BuildRecurringTransaction(TransactionLineBuilder.DefaultAmount);

            transaction.EndYearMonth = new YearMonth(2019, 2);

            transaction.IncludeLines(lines, new YearMonth(2019, 1), new YearMonth(2019, 6));

            Assert.Equal(2, lines.Count);
        }
Exemple #2
0
        public void CreateRecurringTransactions()
        {
            List <TransactionLine> lines = TransactionLineBuilder.BuildList()
                                           .Add(TransactionLineBuilder.DefaultAmount, month: 4)
                                           .Build();

            RecurringTransaction transaction = TransactionLineBuilder.BuildRecurringTransaction(TransactionLineBuilder.DefaultAmount);

            transaction.IncludeLines(lines, new YearMonth(2019, 4), new YearMonth(2019, 6));

            Assert.Equal(4, lines.Count);

            RecurringTransactionLine line = GetFist <RecurringTransactionLine>(lines);

            TransactionLineBuilder.ValidateTransactionLine(line);
        }
Exemple #3
0
        public void CreateRecurringTransactionsConsideringExecutedRecurringTransactions()
        {
            List <TransactionLine> lines = TransactionLineBuilder.BuildList()
                                           .Add(TransactionLineBuilder.BuildExecutedRecurringTransactionLine(TransactionLineBuilder.DefaultAmount, month: 4))
                                           .Add(TransactionLineBuilder.BuildExecutedRecurringTransactionLine(TransactionLineBuilder.DefaultAmount, month: 5))
                                           .Add(TransactionLineBuilder.DefaultAmount, month: 6)
                                           .Add(TransactionLineBuilder.DefaultAmount, month: 7)
                                           .Build();

            RecurringTransaction transaction = TransactionLineBuilder.BuildRecurringTransaction(TransactionLineBuilder.DefaultAmount);

            transaction.IncludeLines(lines, new YearMonth(2019, 4), new YearMonth(2019, 7));

            Assert.Equal(6, lines.Count);

            RecurringTransactionLine line = GetFist <RecurringTransactionLine>(lines);

            TransactionLineBuilder.ValidateTransactionLine(line, date: new DateTime(2019, 6, TransactionLineBuilder.DefaultDay));
        }