public void ForDate_25_1_2014_ShouldReturnBudget2() { BudgetCollection subject = Arrange(); BudgetModel result = subject.ForDate(new DateTime(2014, 1, 25)); Assert.AreSame(subject.First(b => b.Name == TestDataConstants.Budget2Name), result); }
public void ValidateShouldReturnTrueGivenBudgetsWithDuplicateEffectiveDates() { BudgetCollection subject = Arrange(); subject.Add( new BudgetModelFake { EffectiveFrom = subject.First().EffectiveFrom, Name = Guid.NewGuid().ToString() }); Assert.IsTrue(subject.Validate(new StringBuilder())); }
public void ValidateShouldFixGivenBudgetsWithDuplicateEffectiveDates() { BudgetCollection subject = Arrange(); subject.Add( new BudgetModelFake { EffectiveFrom = subject.First().EffectiveFrom, Name = Guid.NewGuid().ToString() }); subject.Validate(new StringBuilder()); Assert.IsTrue(subject.GroupBy(b => b.EffectiveFrom).Sum(group => group.Count()) == 3); }