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

            model.AddCategory(category);
            model.AddIncome(20);
            model.AddSpending(category, 5);
            model.AddSpending(category, 12);
            DateTime start    = new DateTime(2019, 2, 19);
            DateTime end      = DateTime.Today;
            decimal  expected = 17;

            decimal actual = model.ShowAllSpendingsByInterval(start, end);

            Assert.That(actual, Is.EqualTo(expected));
        }
Пример #2
0
        public void ShowAllSpendingsByInterval_NoSpendingsInDateInterval_Return0()
        {
            BudgetModel model     = new BudgetModel();
            string      category1 = "clothes";
            string      category2 = "travelling";

            model.AddCategory(category1);
            model.AddCategory(category2);
            model.AddIncome(20);
            model.AddSpending(category1, 5);
            model.AddSpending(category2, 12);
            DateTime start    = new DateTime(2019, 2, 18);
            DateTime end      = new DateTime(2019, 2, 19);
            decimal  expected = 0;

            decimal actual = model.ShowAllSpendingsByInterval(start, end);

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