當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。