public void CreateNewFixedBudgetProjectShouldThrowGivenCodeAlreadyExists() { InMemoryBudgetBucketRepository subject = CreateSubject(); subject.GetOrCreateNew(FixedBudgetProjectBucket.CreateCode("Foo"), () => new FixedBudgetProjectBucket("Foo", "Foo bajh", 2000)); subject.CreateNewFixedBudgetProject("Foo", "Foo var", 1000); Assert.Fail(); }
public void GetByOrCreateNewShouldThrowGivenNullFactory() { InMemoryBudgetBucketRepository subject = Arrange(); subject.GetOrCreateNew("CODE", null); Assert.Fail(); }
public void GetOrAddShouldAddWhenItemDoesntExist() { InMemoryBudgetBucketRepository subject = Arrange(); subject.GetOrCreateNew("Foo", () => new IncomeBudgetBucket("Foo", "Bar")); Assert.IsTrue(subject.IsValidCode("Foo")); }
public void GetByOrCreateNewShouldThrowGivenNullCode() { InMemoryBudgetBucketRepository subject = Arrange(); subject.GetOrCreateNew(null, () => new PayCreditCardBucket()); Assert.Fail(); }
public void GetOrAddShouldNotAddWhenItemDoesExist() { InMemoryBudgetBucketRepository subject = Arrange(); int count = subject.Buckets.Count(); subject.GetOrCreateNew( TestDataConstants.HairBucketCode, () => { Assert.Fail(); return(new IncomeBudgetBucket(TestDataConstants.HairBucketCode, "Bar")); }); Assert.AreEqual(count, subject.Buckets.Count()); }