Пример #1
0
        public void ShowSpendingsInCategoryByInterval_CategoryIsNull_Return0()
        {
            BudgetModel model    = new BudgetModel();
            string      category = "food";

            model.AddCategory(category);
            model.AddIncome(20);
            model.AddSpending(category, 5);
            model.AddSpending(category, 8);
            DateTime start    = new DateTime(2019, 2, 10);
            DateTime end      = new DateTime(2019, 2, 19);
            decimal  expected = 0;

            decimal actual = model.ShowSpendingsInCategoryByInterval(null, start, end);

            Assert.That(actual, Is.EqualTo(expected));
        }
Пример #2
0
        public void ShowSpendingsInCategoryByInterval_TwoSpendingsWithAmounts5And8_Return13()
        {
            BudgetModel model    = new BudgetModel();
            string      category = "food";

            model.AddCategory(category);
            model.AddIncome(20);
            model.AddSpending(category, 5);
            model.AddSpending(category, 8);
            DateTime start    = new DateTime(2019, 2, 18);
            DateTime end      = DateTime.Today;
            decimal  expected = 13;

            decimal actual = model.ShowSpendingsInCategoryByInterval(category, start, end);

            Assert.That(actual, Is.EqualTo(expected));
        }