Exemple #1
0
        public void InitialiseShouldPopulateKnownBuckets()
        {
            InMemoryBudgetBucketRepository subject = Arrange();

            Assert.IsTrue(subject.IsValidCode(TestDataConstants.CarMtcBucketCode));
            Assert.IsTrue(subject.IsValidCode(TestDataConstants.HairBucketCode));
            Assert.IsTrue(subject.IsValidCode(TestDataConstants.FoodBucketCode));
            Assert.IsTrue(subject.IsValidCode(TestDataConstants.IncomeBucketCode));
        }
Exemple #2
0
        public void CreateNewFixedBudgetProjectShouldReturnNewBucket()
        {
            InMemoryBudgetBucketRepository subject = CreateSubject();
            FixedBudgetProjectBucket       result  = subject.CreateNewFixedBudgetProject("Foo", "Foo var", 1000);

            Assert.IsNotNull(result);
            Assert.IsTrue(subject.IsValidCode(result.Code));
        }
Exemple #3
0
        public void IsValidCodeShouldThrowGivenNullCode()
        {
            InMemoryBudgetBucketRepository subject = Arrange();

            subject.IsValidCode(null);

            Assert.Fail();
        }
Exemple #4
0
        public void GetOrAddShouldAddWhenItemDoesntExist()
        {
            InMemoryBudgetBucketRepository subject = Arrange();

            subject.GetOrCreateNew("Foo", () => new IncomeBudgetBucket("Foo", "Bar"));

            Assert.IsTrue(subject.IsValidCode("Foo"));
        }
Exemple #5
0
        public void AfterInitialiseSurplusBucketShouldExist()
        {
            InMemoryBudgetBucketRepository subject = CreateSubject();

            subject.Initialise(new List <BudgetBucketDto>());

            Assert.IsTrue(subject.IsValidCode(SurplusBucket.SurplusCode));
            Assert.IsInstanceOfType(subject.GetByCode(SurplusBucket.SurplusCode), typeof(SurplusBucket));
        }
Exemple #6
0
        public void IsValidCodeShouldReturnFalseWhenRepositoryIsEmpty()
        {
            InMemoryBudgetBucketRepository subject = CreateSubject();

            Assert.IsFalse(subject.IsValidCode(SurplusBucket.SurplusCode));
        }