当前位置: 首页>>代码示例>>C#>>正文


C# Loan.CalculateExpectedOLB方法代码示例

本文整理汇总了C#中OpenCBS.CoreDomain.Contracts.Loans.Loan.CalculateExpectedOLB方法的典型用法代码示例。如果您正苦于以下问题:C# Loan.CalculateExpectedOLB方法的具体用法?C# Loan.CalculateExpectedOLB怎么用?C# Loan.CalculateExpectedOLB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenCBS.CoreDomain.Contracts.Loans.Loan的用法示例。


在下文中一共展示了Loan.CalculateExpectedOLB方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestCalculateExpectedOLB

        public void TestCalculateExpectedOLB()
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.Flat,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1 }
            };
            package.KeepExpectedInstallment = false;
            package.AnticipatedRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
            Loan myContract = new Loan(package, 20000, 0.02, 10, 0, new DateTime(2009, 1, 17), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(new User()));
            myContract.BadLoan = false;

            myContract.Repay(1, new DateTime(2009, 1, 17), 10000, true, false);

            Assert.AreEqual(10000, myContract.CalculateExpectedOLB(1, false).Value);
            Assert.AreEqual(9000, myContract.CalculateExpectedOLB(2, false).Value);
            Assert.AreEqual(8000, myContract.CalculateExpectedOLB(3, false).Value);
            Assert.AreEqual(7000, myContract.CalculateExpectedOLB(4, false).Value);
            Assert.AreEqual(6000, myContract.CalculateExpectedOLB(5, false).Value);
            Assert.AreEqual(5000, myContract.CalculateExpectedOLB(6, false).Value);
            Assert.AreEqual(4000, myContract.CalculateExpectedOLB(7, false).Value);
            Assert.AreEqual(3000, myContract.CalculateExpectedOLB(8, false).Value);
            Assert.AreEqual(2000, myContract.CalculateExpectedOLB(9, false).Value);
            Assert.AreEqual(1000, myContract.CalculateExpectedOLB(10, false).Value);
        }
开发者ID:aelhadi,项目名称:opencbs,代码行数:27,代码来源:TestCreditContractRepayment.cs

示例2: TestCalculateOLBWith2MonthOfGracePeriodWhenDecliningExotic

        public void TestCalculateOLBWith2MonthOfGracePeriodWhenDecliningExotic()
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.DecliningFixedInstallments,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1 }
            };

            ExoticInstallmentsTable exoticProduct = new ExoticInstallmentsTable();
            exoticProduct.Add(new ExoticInstallment(1, 0.1, null));
            exoticProduct.Add(new ExoticInstallment(2, 0.1, null));
            exoticProduct.Add(new ExoticInstallment(3, 0.1, null));
            exoticProduct.Add(new ExoticInstallment(4, 0.1, null));
            exoticProduct.Add(new ExoticInstallment(5, 0.1, null));
            exoticProduct.Add(new ExoticInstallment(6, 0.5, null));
            package.ExoticProduct = exoticProduct;

            Loan myContract = new Loan(package, 1000, 0.03, 8, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(new User()));
            myContract.Repay(1, new DateTime(2006, 2, 1), 100, true, false);

            Assert.AreEqual(1000m, myContract.CalculateExpectedOLB(1, false).Value);
            Assert.AreEqual(930m, myContract.CalculateExpectedOLB(2, false).Value);
            Assert.AreEqual(930m, myContract.CalculateExpectedOLB(3, false).Value);
            Assert.AreEqual(837m, myContract.CalculateExpectedOLB(4, false).Value);
            Assert.AreEqual(744m, myContract.CalculateExpectedOLB(5, false).Value);
            Assert.AreEqual(651m, myContract.CalculateExpectedOLB(6, false).Value);
            Assert.AreEqual(558m, myContract.CalculateExpectedOLB(7, false).Value);
            Assert.AreEqual(465m, myContract.CalculateExpectedOLB(8, false).Value);
        }
开发者ID:aelhadi,项目名称:opencbs,代码行数:31,代码来源:TestCreditContractRepayment.cs

示例3: TestCalculateOLB6

        public void TestCalculateOLB6()
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.Flat,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1 }
            };
            package.KeepExpectedInstallment = false;
            package.AnticipatedRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
            Loan myContract = new Loan(package, 1000, 0.03, 6, 1, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(new User()));
            myContract.BadLoan = false;
            myContract.AnticipatedRepaymentPenalties = 0.03;

            myContract.Repay(1, new DateTime(2006, 2, 1), 30, false, false);

            RepaymentEvent rE = myContract.Repay(2, new DateTime(2006, 3, 3), 1000, false, true);
            Assert.AreEqual(0m, rE.Fees.Value);
            Assert.AreEqual(150m, rE.Interests.Value);
            Assert.AreEqual(850m, rE.Principal.Value);

            Assert.AreEqual(1000m, myContract.CalculateExpectedOLB(1, true).Value);
            Assert.AreEqual(1000m, myContract.CalculateExpectedOLB(2, true).Value);
            Assert.AreEqual(800m, myContract.CalculateExpectedOLB(3, true).Value);
            Assert.AreEqual(600m, myContract.CalculateExpectedOLB(4, true).Value);
            Assert.AreEqual(400m, myContract.CalculateExpectedOLB(5, true).Value);
            Assert.AreEqual(200m, myContract.CalculateExpectedOLB(6, true).Value);
        }
开发者ID:aelhadi,项目名称:opencbs,代码行数:29,代码来源:TestCreditContractRepayment.cs

示例4: TestCalculateOLBWith2MonthOfGracePeriod

        public void TestCalculateOLBWith2MonthOfGracePeriod()
        {
            ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.Flat,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1 }
            };
            package.KeepExpectedInstallment = false;
            package.AnticipatedRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
            Loan myContract = new Loan(package, 1000, 0.03, 7, 2, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(new User()));
            myContract.BadLoan = false;
            myContract.AnticipatedRepaymentPenalties = 0.03;

            Assert.AreEqual(1000m, myContract.CalculateExpectedOLB(1, false).Value);
            Assert.AreEqual(1000m, myContract.CalculateExpectedOLB(2, false).Value);
            Assert.AreEqual(1000m, myContract.CalculateExpectedOLB(3, false).Value);
            Assert.AreEqual(800m, myContract.CalculateExpectedOLB(4, false).Value);
            Assert.AreEqual(600m, myContract.CalculateExpectedOLB(5, false).Value);
            Assert.AreEqual(400m, myContract.CalculateExpectedOLB(6, false).Value);
            Assert.AreEqual(200m, myContract.CalculateExpectedOLB(7, false).Value);
        }
开发者ID:aelhadi,项目名称:opencbs,代码行数:24,代码来源:TestCreditContractRepayment.cs

示例5: TestCalculateOLB4

        public void TestCalculateOLB4()
        {
            LoanProduct package = new LoanProduct
            {
                InstallmentType = new InstallmentType(1, "Monthly", 0, 1),
                LoanType = OLoanTypes.DecliningFixedInstallments,
                ChargeInterestWithinGracePeriod = true,
                Currency = new Currency { Id = 1 }
            };
            package.KeepExpectedInstallment = false;
            package.AnticipatedRepaymentPenaltiesBase = OAnticipatedRepaymentPenaltiesBases.RemainingOLB;
            Loan myContract = new Loan(package, 1000, 0.03, 6, 0, new DateTime(2006, 1, 1), new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(new User()));
            myContract.BadLoan = false;
            myContract.AnticipatedRepaymentPenalties = 0.03;

            Assert.AreEqual(1000m, myContract.CalculateExpectedOLB(1, false).Value);
            Assert.AreEqual(845.40m, myContract.CalculateExpectedOLB(2, false).Value);
            Assert.AreEqual(686.16m, myContract.CalculateExpectedOLB(3, false).Value);
            Assert.AreEqual(522.14m, myContract.CalculateExpectedOLB(4, false).Value);
            Assert.AreEqual(353.21m, myContract.CalculateExpectedOLB(5, false).Value);
            Assert.AreEqual(179.22m, myContract.CalculateExpectedOLB(6, false).Value);

            myContract.Repay(1,new DateTime(2006,2,1),184.60m,false,false);

            RepaymentEvent rE = myContract.Repay(2, new DateTime(2006, 4, 3), 369.2m, false, false);

            Assert.AreEqual(25.36m, rE.Fees.Value);
            Assert.AreEqual(45.94m, rE.Interests.Value);
            Assert.AreEqual(297.9m, rE.Principal.Value);

            Assert.AreEqual(1000, myContract.CalculateExpectedOLB(1, false).Value);
            Assert.AreEqual(845.40m, myContract.CalculateExpectedOLB(2, false).Value);
            Assert.AreEqual(686.16m, myContract.CalculateExpectedOLB(3, false).Value);
            Assert.AreEqual(522.14m, myContract.CalculateExpectedOLB(4, false).Value);
            Assert.AreEqual(353.21m, myContract.CalculateExpectedOLB(5, false).Value);
            Assert.AreEqual(179.22m, myContract.CalculateExpectedOLB(6, false).Value);
        }
开发者ID:aelhadi,项目名称:opencbs,代码行数:37,代码来源:TestCreditContractRepayment.cs


注:本文中的OpenCBS.CoreDomain.Contracts.Loans.Loan.CalculateExpectedOLB方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。