public CashflowEditorViewModel(
                ICashflowRepository cashflowRepository,
                IBankAccountRepository bankAccountRepository,
                Cashflow entity
            )
        {
            this.cashflowRepository = cashflowRepository;
            this.bankAccountRepository = bankAccountRepository;
            this.entity = entity;

            this.OpeningBalance.PropertyChanged += (s,e) =>
                {
                    base.Validate();
                };
            base.ValidationHelper.AddInstance(this.OpeningBalance);
        }
        public void Initialize()
        {
            //IBankAccountRepository bankAccountRepo;
            //ITransferRepository transferRepo;

            List<CashflowProjectionTransfer> cashflowProjectionTransfers = null;

            //mockIProjectionTransferGenerator = new Mock<IProjectionTransferGenerator>();

            mockIProjectionTransferGenerator
                .Setup(s => s.GenerateCashflowProjectionTransfersAsync(
                            It.IsAny<List<CashflowBankAccount>>(),
                            It.IsAny<DateTime>(),
                            It.IsAny<DateTime>()
                            )
                )
                .Returns(Task.Factory.StartNew(()=>cashflowProjectionTransfers));

            //fakeBankAccountRepository = new FakeBankAccountRepository();

            //mockTransferFrequencyDateCalculatorFactory = new Mock<IScheduleFrequencyCalculatorFactory>();
            //mockTransferDirectionGenerator = new Mock<ITransferDirectionGenerator>();

            //mockTransferFrequencyDateCalculatorMonthly = new Mock<IScheduleFrequencyCalculator>();

            //mockTransferFrequencyDateCalculatorMonthly.Setup(s => s.CalculateNextDate(It.IsAny<Schedule>(), It.IsAny<DateTime>()))
            //    .Returns((Transfer t, DateTime d) => d.AddMonths(1));

            sut = new Cashflow(new CashflowProjection(mockIProjectionTransferGenerator.Object,null))
            {
                OpeningBalance = 5000,
                StartDate = new DateTime(2015, 08, 1),
                CashflowBankAccounts = new List<CashflowBankAccount>()
                {
                    new CashflowBankAccount()
                    {
                        BankAccount = new BankAccount()
                        {
                            BankAccountId=1
                        }
                    }
                }
            };
        }
 public CashflowItemViewModel(Cashflow entity)
 {
     this.entity = entity;
 }
        public void Initialize()
        {
            /*
            * Cashflow(IProjectionTransferGenerator)
            *
            * ProjectionTransferGenerator(IBankAccountRepository,ITransferDirectionGenerator) : IProjectionTransferGenerator
            *
            * TransferDirectionGenerator(ITransferRepository) : ITransferDirectionGenerator
            *
            */

            transfers = new List<Transfer>()
            {
                new Transfer(new FakeScheduleFactory())
                {
                    TransferId=1,
                    FromBankAccount = new BankAccount() { BankAccountId=1 },
                    ToBankAccount = new BankAccount() { BankAccountId=2 },
                    Amount = transferAmount,
                    Category = new TransferCategory() { Code="NONE" },
                    IsEnabled = true,
                    Schedule = new Schedule(scheduleFrequencyCalculators)
                    {
                        StartDate = cashflowStartDate,
                        EndDate = new DateTime(2016,08,01),
                        Frequency = "Monthly",
                        FrequencyEvery = 1
                    }
                }
            };

            mockTransferRepository
                .Setup(s => s.ReadList())
                .Returns(transfers);

            fakeBankAccountRepository = new FakeBankAccountRepository();

            sut = new Cashflow(new CashflowProjection(new CashflowProjectionTransferGenerator(fakeBankAccountRepository,
                                new TransferDirectionGenerator(mockTransferRepository.Object)),null))
            {
                OpeningBalance = cashflowOperningBalance,
                StartDate = cashflowStartDate,
                CashflowBankAccounts = new List<CashflowBankAccount>()
                {
                    new CashflowBankAccount()
                    {
                        BankAccount = new BankAccount()
                        {
                            BankAccountId=1
                        }
                    }
                }
            };
        }