Beispiel #1
0
        public void PriceCalcTest()
        {
            double installment = PriceSystem.GetInstallments(presentValue, rate, time);

            Assert.AreEqual(presentValue, Math.Round(PriceSystem.GetPresentValue(installment, rate, time), 2));
            Assert.AreEqual(Math.Round(rate, 3), Math.Round(PriceSystem.GetRate(presentValue, installment, time), 3));
        }
Beispiel #2
0
        public void GetMonthlyInstallmentsTest()
        {
            double d = 35000;
            float  t = 3.4f / 100;
            int    n = 260;

            var tx = PriceSystem.GetRate(35000, 998.60, 48);
            //PriceSystemTable priceTable = new PriceSystemTable(35000, tx, 48);
            //var a = priceTable.ToList();
            double vf = Math.Round(PriceSystem.GetInstallments(d, t, n), 2);

            double test = PriceSystem.GetPresentValue(vf, t, n);

            var i = Math.Round(PriceSystem.GetRate(d, vf, n) * 100, 2);

            i = Math.Round(PriceSystem.GetRate(29000, 738.3, 60) * 100, 2);

            //var l = SAC.GetInstallmentsX(d / n, (n - 1 + 1) * t * (d / n));
            //Assert.Fail();
        }