public void CanBeInitialized() { var db = new LittleDB("newYorkTryp"); var newYorkExpenses = new Tryp(db); var today = DateTime.Now; newYorkExpenses.Initialize(today, 50, 0); newYorkExpenses.GetBudget().Total.Should().Be(50); newYorkExpenses.GetBudget().Daily.Should().Be(50); }
public void EachTimeIInstantiateItShouldUpdateTheTotalBudgetBasedOnDays() { var twoDaysAgo = DateTime.Today.AddDays(-2); var db = new LittleDB("newYorkTryp"); var newyorkExpenses = new Tryp(db); newyorkExpenses.Initialize(twoDaysAgo, 20, 0); newyorkExpenses.GetBudget().Total.ShouldBeEquivalentTo(60); }
public void ItShoulndAddBudgetByDaysAlreadyCounted() { var twoDaysAgo = DateTime.Today.AddDays(-2); var db = new LittleDB("newYorkTryp"); var newyorkExpenses = new Tryp(db); newyorkExpenses.Initialize(twoDaysAgo, 20, 0); newyorkExpenses.GetBudget().Total.ShouldBeEquivalentTo(60); var anotherInstance = new Tryp(db); anotherInstance.GetBudget().Total.ShouldBeEquivalentTo(60); }
public void ItShouldUpdateTheBudgetonInstance() { var db = new LittleDB("newYorkTryp"); var threeDaysAgo = DateTime.Today.AddDays(-3); var twoDaysAgo = DateTime.Today.AddDays(-2); db.SaveList(new List<DateTime>(){threeDaysAgo, twoDaysAgo}); var budget = new Budget {Daily = 20, Id = 1, Total = 40}; db.Save(budget); var newyorkExpenses = new Tryp(db); newyorkExpenses.GetBudget().Total.ShouldBeEquivalentTo(80); }