Ejemplo n.º 1
0
 void ValidateSerializedTestBudget(Budget budget)
 {
     Assert.That(budget.TotalNet, Is.EqualTo(_budget.TotalNet));
     for (int month = 1; month <= 12; ++month)
     {
         Assert.That(budget.MonthlyTotal(month), Is.EqualTo(_budget.MonthlyTotal(month)));
     }
 }
Ejemplo n.º 2
0
        public void CanSupportWeeklyBudgetEntriesWithLimit()
        {
            var entry1 = new BudgetEntryWeekly(681, "WA Unemployment", BudgetType.Income_Unemployment, start: "Feb 11", period: 1, max: 26);

            _budget.AddEntry(entry1);
            Assert.That(_budget.MonthlyTotal(1), Is.EqualTo(0.0));
            Assert.That(_budget.MonthlyTotal(2), Is.EqualTo(3 * 681.00));
            Assert.That(_budget.MonthlyTotal(3), Is.EqualTo(4 * 681.00));
            Assert.That(_budget.MonthlyTotal(4), Is.EqualTo(5 * 681.00));
            Assert.That(_budget.MonthlyTotal(5), Is.EqualTo(4 * 681.00));
            Assert.That(_budget.MonthlyTotal(6), Is.EqualTo(4 * 681.00));
            Assert.That(_budget.MonthlyTotal(7), Is.EqualTo(5 * 681.00));
            Assert.That(_budget.MonthlyTotal(8), Is.EqualTo(1 * 681.00));
            Assert.That(_budget.MonthlyTotal(9), Is.EqualTo(0.0));
            Assert.That(_budget.TotalIncome, Is.EqualTo(17706));
        }