public void CanCreateEmptyBudget() { BudgetFactory.CreateBudget(2017, "AnyOldUser"); var budget = BudgetFactory.GetBudget(); Assert.That(budget, Is.TypeOf(typeof(Budget))); Assert.That(budget.TotalNet, Is.EqualTo(0.0)); }
public void CanCreateDailyBudget() { BudgetFactory.CreateDaily(BudgetType.Personal, "Food", 10.00); var budget = BudgetFactory.GetBudget(); Assert.That(budget.TotalExpenses, Is.EqualTo(365 * 10.0)); BudgetFactory.CreateBudget(2017); BudgetFactory.CreateDaily(BudgetType.Personal, "Food", 10.00, "Jan 2, 2017"); Assert.That(BudgetFactory.GetBudget().TotalExpenses, Is.EqualTo(364.0 * 10.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)); }
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); }
public void CreateBudgetEntryTests() { var budgetEntry = BudgetFactory.CreateBudgetEntry("Annual", "Personal", "10", "annualExample", "2"); Assert.That(budgetEntry, Is.TypeOf(typeof(BudgetEntryAnnual))); budgetEntry = BudgetFactory.CreateBudgetEntry("BiAnnual", "Personal", "10", "biAnnualExample", "2"); Assert.That(budgetEntry, Is.TypeOf(typeof(BudgetEntryBiAnnual))); budgetEntry = BudgetFactory.CreateBudgetEntry("Monthly", "Personal", "10", "monthlyExample"); Assert.That(budgetEntry, Is.TypeOf(typeof(BudgetEntryMonthly))); budgetEntry = BudgetFactory.CreateBudgetEntry("BiMonthly", "Personal", "10", "biMonthlyExample", "2"); Assert.That(budgetEntry, Is.TypeOf(typeof(BudgetEntryBiMonthly))); budgetEntry = BudgetFactory.CreateBudgetEntry("Weekly", "Personal", "10", "weeklyExample", "Jan 4", "5", "2"); Assert.That(budgetEntry, Is.TypeOf(typeof(BudgetEntryWeekly))); budgetEntry = BudgetFactory.CreateBudgetEntry("Daily", "Personal", "10", "dailyExample", "Jan 1"); Assert.That(budgetEntry, Is.TypeOf(typeof(BudgetEntryDaily))); }
public void SetUp() { BudgetFactory.CreateBudget(2017, "AnyOldUser"); }
public void CanCreateBiAnnualBudget() { BudgetFactory.CreateBiAnnual(BudgetType.Auto_Insurance, "BMW", 400.00, 4); Assert.That(BudgetFactory.GetBudget().TotalExpenses, Is.EqualTo(2 * 400.0)); }
public void CanCreateMonthlyBudget() { BudgetFactory.CreateMonthly(BudgetType.Home_Mortgage, "Mortgage", 2000); Assert.That(BudgetFactory.GetBudget().TotalExpenses, Is.EqualTo(12 * 2000.0)); }