Example #1
0
        public NpvCalculatorViewModel(IDiscountRateLimiter npvCalculator)
        {
            this.npvCalculator = npvCalculator;

            ComputeNpvCommand   = new DelegateCommand <object>(ComputeNpvExecute, ComputeNpvCanExecute);
            SetCashFlowsCommand = new DelegateCommand <object>(SetCashFlowsExecute);

            NpvParameter = new NpvParameter
            {
                InitialInvestment      = -100000,
                LowerBoundDiscountRate = 0.0365,
                UpperBoundDiscountRate = 0.037,
                DiscountRateIncrement  = 0.0001,
                ProjectLife            = 3
            };

            CashFlows.AddRange(new[] {
                new CashFlow {
                    Index = 0, Cash = 10000
                },
                new CashFlow {
                    Index = 1, Cash = 10000
                },
                new CashFlow {
                    Index = 2, Cash = 10000
                }
            });
        }
 public NpvCalculatorViewModelTests()
 {
     discountRateLimiter = Substitute.For <IDiscountRateLimiter>();
 }