Наследование: BudgetAnalyser.Engine.Budget.InMemoryBudgetBucketRepository
 public void TestInitialise()
 {
     var accountRepo = new InMemoryAccountTypeRepository();
     var bucketRepo = new BucketBucketRepoAlwaysFind();
     var subject = new Mapper_LedgerBookDto_LedgerBook(bucketRepo, accountRepo, new LedgerBucketFactory(bucketRepo, accountRepo), new LedgerTransactionFactory(), new Mock<IReconciliationBuilder>().Object);
     Result = subject.ToModel(TestData);
 }
 public void TestInitialise()
 {
     var bucketRepo = new BucketBucketRepoAlwaysFind();
     var accountRepo = new InMemoryAccountTypeRepository();
     var subject = new Mapper_LedgerBucketDto_LedgerBucket(bucketRepo, accountRepo, new LedgerBucketFactory(bucketRepo, accountRepo));
     Result = subject.ToDto(TestData);
 }
 private BudgetCollectionDto ArrangeAndAct()
 {
     var bucketRepo = new BucketBucketRepoAlwaysFind();
     var mapper = new Mapper_BudgetCollectionDto_BudgetCollection(
         bucketRepo, 
         new Mapper_BudgetBucketDto_BudgetBucket(new BudgetBucketFactory()), 
         new Mapper_BudgetModelDto_BudgetModel(bucketRepo));
     return mapper.ToDto(TestData);
 }
 public void TestInitialise()
 {
     TestData = GetType().Assembly.ExtractEmbeddedResourceAsXamlObject<BudgetCollectionDto>("BudgetAnalyser.Engine.UnitTest.TestData.BudgetCollectionTestData.xml");
     var bucketRepo = new BucketBucketRepoAlwaysFind();
     var subject = new Mapper_BudgetCollectionDto_BudgetCollection(
         bucketRepo,
         new Mapper_BudgetBucketDto_BudgetBucket(new BudgetBucketFactory()), 
         new Mapper_BudgetModelDto_BudgetModel(bucketRepo));
     Result = subject.ToModel(TestData);
 }
        public void TestInitialise()
        {
            this.bucketRepo = new BucketBucketRepoAlwaysFind();
            this.subject = new RemainingSurplusWidget();
            this.criteriaTestData = new GlobalFilterCriteria
            {
                BeginDate = new DateTime(2015, 10, 20),
                EndDate = new DateTime(2015, 11, 19)
            };

            StatementModelTestDataForThisTest.AccountTypeRepo = new InMemoryAccountTypeRepository();
            StatementModelTestDataForThisTest.BudgetBucketRepo = this.bucketRepo;
            this.statementTestData = StatementModelTestDataForThisTest.TestDataGenerated();

            BudgetModel budgetModel = BudgetModelTestData.CreateTestData1();
            this.budgetTestData = new BudgetCurrencyContext(new BudgetCollection(budgetModel), budgetModel);

            this.ledgerBookTestData = new LedgerBookBuilder
            {
                StorageKey = "RemainingSurplusWidgetTest.xml",
                Modified = new DateTime(2015, 11, 23),
                Name = "Smith Budget 2015"
            }
                .IncludeLedger(LedgerBookTestData.PhoneLedger, 130M)
                .IncludeLedger(LedgerBookTestData.CarMtcLedger, 90M)
                .IncludeLedger(LedgerBookTestData.PowerLedger)
                .AppendReconciliation(
                    new DateTime(2015, 10, 20),
                    new BankBalance(LedgerBookTestData.ChequeAccount, 4502.75M))
                .WithReconciliationEntries(
                    entryBuilder =>
                    {
                        entryBuilder.WithLedger(LedgerBookTestData.PhoneLedger).HasNoTransactions();
                        entryBuilder.WithLedger(LedgerBookTestData.CarMtcLedger).HasNoTransactions();
                        entryBuilder.WithLedger(LedgerBookTestData.PowerLedger)
                            .AppendTransactions(txnBuilder => { txnBuilder.WithCredit(3000M, "Oct Savings", new DateTime(2015, 10, 20), "automatchref12"); });
                    })
                .Build();

            this.ledgerCalculation = new LedgerCalculation(new FakeLogger());
        }
        public void TestInitialise()
        {
            this.subject = new BudgetBucketMonitorWidget();
            this.subject.BucketCode = StatementModelTestData.PhoneBucket.Code;

            this.bucketRepo = new BucketBucketRepoAlwaysFind();
            this.criteriaTestData = new GlobalFilterCriteria
            {
                BeginDate = new DateTime(2015, 10, 20),
                EndDate = new DateTime(2015, 11, 19)
            };

            CreateStatementTestData();

            BudgetModel budgetModel = BudgetModelTestData.CreateTestData5();
            this.budgetTestData = new BudgetCurrencyContext(new BudgetCollection(budgetModel), budgetModel);

            CreateLedgerBookTestData();

            this.ledgerCalculation = new LedgerCalculation(new FakeLogger());
        }
        public void TestInitialise()
        {
            var bucketRepo = new BucketBucketRepoAlwaysFind();
            TestData = BudgetModelTestData.CreateCollectionWith1And2();

            // ExtractXaml All Buckets from The Test Data.
            TestDataBuckets = TestData.SelectMany(b => b.Expenses.Cast<BudgetItem>())
                .Union(TestData.SelectMany(b => b.Incomes))
                .Select(x => x.Bucket)
                .Distinct();

            // Preload the buckets into the bucket repo used by the Mapper.
            foreach (BudgetBucket bucket in TestDataBuckets)
            {
                bucketRepo.GetByCode(bucket.Code);
            }

            var subject = new Mapper_BudgetCollectionDto_BudgetCollection(
                bucketRepo, 
                new Mapper_BudgetBucketDto_BudgetBucket(new BudgetBucketFactory()), 
                new Mapper_BudgetModelDto_BudgetModel(bucketRepo));
            Result = subject.ToDto(TestData);
        }
 public void TestInitialise()
 {
     var accountRepo = new InMemoryAccountTypeRepository();
     var bucketRepo = new BucketBucketRepoAlwaysFind();
     this.mapper = new Mapper_LedgerBookDto_LedgerBook(bucketRepo, accountRepo, new LedgerBucketFactory(bucketRepo, accountRepo), new LedgerTransactionFactory(), new Mock<IReconciliationBuilder>().Object);
     this.mockReaderWriterSelector = new Mock<IReaderWriterSelector>();
     this.mockReaderWriter = new Mock<IFileReaderWriter>();
     this.mockReaderWriterSelector.Setup(m => m.SelectReaderWriter(It.IsAny<bool>())).Returns(this.mockReaderWriter.Object);
 }
 private LedgerBookDto ArrangeAndAct()
 {
     var bucketRepo = new BucketBucketRepoAlwaysFind();
     var accountRepo = new InMemoryAccountTypeRepository();
     var mapper = new Mapper_LedgerBookDto_LedgerBook(bucketRepo, accountRepo, new LedgerBucketFactory(bucketRepo, accountRepo), new LedgerTransactionFactory(), new Mock<IReconciliationBuilder>().Object);
     return mapper.ToDto(TestData);
 }
        private XamlOnDiskMatchingRuleRepositoryTestHarness ArrangeUsingMocks()
        {
            var bucketRepo = new BucketBucketRepoAlwaysFind();
            MatchingRulesTestDataGenerated.BucketRepo = bucketRepo;

            return new XamlOnDiskMatchingRuleRepositoryTestHarness(
                new Mapper_MatchingRuleDto_MatchingRule(new BucketBucketRepoAlwaysFind()),
                this.mockSelector.Object);
        }
        private XamlOnDiskMatchingRuleRepositoryTestHarness ArrangeUsingEmbeddedResources()
        {
            var bucketRepo = new BucketBucketRepoAlwaysFind();
            MatchingRulesTestDataGenerated.BucketRepo = bucketRepo;

            return new XamlOnDiskMatchingRuleRepositoryTestHarness(
                new Mapper_MatchingRuleDto_MatchingRule(new BucketBucketRepoAlwaysFind()),
                new LocalDiskReaderWriterSelector(
                    new [] { new EmbeddedResourceFileReaderWriter() }));
        }