public void AddMonthlyCashStatement(MonthlyCashStatementCategory category, YearMonth month, DateTime date, int amount, string description, bool isFinal = true)
 {
     Add(data.MonthlyCashMovements, new MonthlyCashStatement(category, month, date, amount, description)
     {
         IsFinalPayment = isFinal
     });
 }
Esempio n. 2
0
        public void ShouldBeEffectiveStartingCurrentMonthByDefault()
        {
            NowIs(5.02.of2009());

            var category = new MonthlyCashStatementCategory(5, 0, "jam");

            Assert.AreEqual(new DateTime(2009, 2, 1), category.Effective.From);
        }
        public void CanSetExpenseItem()
        {
            var expense   = new MonthlyCashStatementCategory(1, 10, "Gaz");
            var peExpense = new PESelectableExpenseItem(expense);

            Assert.AreEqual("Gaz", peExpense.ToString());
            Assert.AreSame(expense, peExpense.ExpenseItem);
        }
        public void DeleteMonthlyExpenses()
        {
            ArrangeWeeks(02.02.of2009());
            var expenseItem = new MonthlyCashStatementCategory(1, 1, "Gaz");
            var expense1    = new MonthlyCashStatement(expenseItem, month(2), 03.02.of2009(), 10, "1");
            var expense2    = new MonthlyCashStatement(expenseItem, month(2), 03.02.of2009(), 20, "2");

            budget.MonthlyCashMovements = new[] { expense1, expense2 };

            ExpectDeletion(x => x.DeleteMonthlyCashMovement(expense1));
            //

            Run();

            view.CalculationResultsFake.DataSource.ElementAt(2).Delete();
        }
        public void Run(MonthlyCashStatementCategory expenseItem)
        {
            this.expenseItem = expenseItem;

            peExpenseItem = new PEEditableExpenseItem {
                DayOfMonth = expenseItem.DayOfMonth,
                Amount     = expenseItem.Amount,
                Name       = expenseItem.Name,
                From       = expenseItem.Effective.From,
                To         = expenseItem.Effective.To.AddDays(-1),
            };

            view.Text           = "Править статью расходов";
            view.OnOK           = OnOK;
            view.MonthlyExpense = peExpenseItem;

            view.Show();
        }
Esempio n. 6
0
 private void Run(MonthlyCashStatementCategory expenseItem)
 {
     useCase = new EditExpenseItemUseCase(dataSavingServiceMock.Object, view);
     useCase.Run(expenseItem);
 }
Esempio n. 7
0
        public void ShouldBeEffectiveByTheEndOfTimeByDefault()
        {
            var category = new MonthlyCashStatementCategory(5, 0, "jam");

            Assert.AreEqual(DateTimeService.MaxValue, category.Effective.To);
        }
Esempio n. 8
0
 public PESelectableExpenseItem(MonthlyCashStatementCategory expenseItem)
 {
     this.expenseItem = expenseItem;
 }