Exemple #1
0
        public void CanCreateWeeklyBudget()
        {
            BudgetFactory.CreateWeekly(BudgetType.Personal, "Dues", 10.00);
            Assert.That(BudgetFactory.GetBudget().TotalExpenses, Is.EqualTo(52 * 10.0));

            BudgetFactory.CreateBudget(2017);
            BudgetFactory.CreateWeekly(BudgetType.Personal, "Dues", 10.00, period: 2);
            Assert.That(BudgetFactory.GetBudget().TotalExpenses, Is.EqualTo(26 * 10.0));

            BudgetFactory.CreateBudget(2017);
            BudgetFactory.CreateWeekly(BudgetType.Personal, "Dues", 10.00, period: 1, start: "Jan 10, 2017");
            Assert.That(BudgetFactory.GetBudget().TotalExpenses, Is.EqualTo(51 * 10.0));

            BudgetFactory.CreateBudget(2017);
            BudgetFactory.CreateWeekly(BudgetType.Personal, "Dues", 10.00, period: 1, start: "Jan 1, 2017", max: 51);
            Assert.That(BudgetFactory.GetBudget().TotalExpenses, Is.EqualTo(51 * 10.0));
        }
Exemple #2
0
        public static Budget CreateBudget(int year, string user)
        {
            BudgetFactory.CreateBudget(year, user);
            BudgetFactory.CreateMonthly(BudgetType.Home_Mortgage, "Mortgage", 2000);
            BudgetFactory.CreateMonthly(BudgetType.Utilities_InternetCable, "Comcast", 242.00);
            BudgetFactory.CreateMonthly(BudgetType.Utilities_Gas, "Gas", 90.00);
            BudgetFactory.CreateBiMonthly(BudgetType.Utilities_WaterSewerWaste, "SPU", 190.00, 1);
            BudgetFactory.CreateBiMonthly(BudgetType.Utilities_Electricity, "SCL", 80.00, 1);

            BudgetFactory.CreateBiAnnual(BudgetType.Auto_Insurance, "BMW", 463.00, 4);
            BudgetFactory.CreateAnnual(BudgetType.Auto_Insurance, "Vespa", 389.00, 4);
            BudgetFactory.CreateMonthly(BudgetType.Auto_Gas, "Gas", 60.00);

            BudgetFactory.CreateMonthly(BudgetType.Medical_Insurance, "Regence", 749.00);

            BudgetFactory.CreateDaily(BudgetType.Personal_Dining, "Food", 50.00);

            BudgetFactory.CreateMonthly(BudgetType.Media_Music, "EchoDot", 3.99);
            BudgetFactory.CreateAnnual(BudgetType.Media_Music, "AmazonCloud", 24.99, 2);
            BudgetFactory.CreateMonthly(BudgetType.Media_Subscription, "Github", 7.00);
            BudgetFactory.CreateAnnual(BudgetType.Media_Subscription, "AmazonPrime", 99.00, 12);
            BudgetFactory.CreateAnnual(BudgetType.Shopping_Subscription, "Costco", 55.00, 3);
            BudgetFactory.CreateMonthly(BudgetType.Media_Movies, "Netflix", 10.95);
            BudgetFactory.CreateMonthly(BudgetType.Media_Movies, "CBS", 7.95);
            BudgetFactory.CreateAnnual(BudgetType.Media_Subscription, "Lastpass", 13.61, 4);
            BudgetFactory.CreateWeekly(BudgetType.Personal, "Haircut", 60.00, period: 6, start: "Jan 11");
            BudgetFactory.CreateWeekly(BudgetType.Income_Unemployment, "WA Unemployment", 681.00, start: "Feb 11", period: 1, max: 26);

            BudgetFactory.CreateAnnual(BudgetType.Entertainment_SportingEvents, "Mariners", 900.00, 1);
            BudgetFactory.CreateAnnual(BudgetType.Entertainment_Movies, "SIFF", 600.00, 12);

            BudgetFactory.CreateAnnual(BudgetType.Gift_FamilyFriends, "Christmas", 1600.00, 12);
            BudgetFactory.CreateAnnual(BudgetType.Gift_FamilyFriends, "Michelle", 150, 3);
            BudgetFactory.CreateAnnual(BudgetType.Gift_FamilyFriends, "Chris", 150, 1);
            BudgetFactory.CreateAnnual(BudgetType.Gift_FamilyFriends, "Thea", 150, 10);
            BudgetFactory.CreateAnnual(BudgetType.Gift_FamilyFriends, "Dan", 100, 8);

            var budget = BudgetFactory.GetBudget();

            Console.WriteLine(budget);

            return(budget);
        }