public void TestAddInstallmentAndGetInstallment() { Loan newContract = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User())); new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User())); Installment i = new Installment {PaidCapital = 100}; newContract.AddInstallment(i); Assert.AreEqual(100m,newContract.GetInstallment(0).PaidCapital.Value); }
public void SetUp() { addDataForTesting.DeleteInstallments(); addDataForTesting.DeleteCreditContract(); addDataForTesting.DeletedProject(); addDataForTesting.DeleteInstallmentTypes(); addDataForTesting.DeleteTiers(); addDataForTesting.DeleteAllUser(); addDataForTesting.AddGenericFundingLine(); collateral = addDataForTesting.AddCollateral(); biWeekly = addDataForTesting.AddBiWeeklyInstallmentType(); package.Id = addDataForTesting.AddGenericPackage(); package.Name = "Package"; user.Id = addDataForTesting.AddUserWithIntermediaryAttributs(); //addDataForTesting.AddGenericFundingLine(); tiers.Id = addDataForTesting.AddGenericTiersIntoDatabase(OClientTypes.Group); tiers.LoanCycle = 1; _project = new Project(); _project.ProjectStatus = OProjectStatus.Refused; _project.Name = "NotSet"; _project.Code = "NotSet"; _project.Aim = "NotSet"; _project.BeginDate = TimeProvider.Today; _project.Id = projectManager.Add(_project, tiers.Id, null); //fundingLine = new FundingLine("AFD130",false); credit = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisioningTable.GetInstance(new User())); credit.LoanOfficer = user; credit.BranchCode = "DU"; credit.CreationDate = DateTime.Today.AddDays(-1); credit.StartDate = DateTime.Today; credit.CloseDate = DateTime.Today.AddDays(1); credit.Closed = true; credit.Rural = true; credit.Product = package; credit.Amount = 1000m; credit.InterestRate = 3; credit.InstallmentType = biWeekly; credit.NbOfInstallments = 2; credit.NonRepaymentPenalties.InitialAmount = 2.5; credit.AnticipatedRepaymentPenalties = 1.2; credit.Disbursed = false; credit.LoanOfficer = user; credit.FundingLine = new FundingLine { Name = "AFD130" }; credit.EntryFees = 2.05; credit.WriteOff = false; credit.Rescheduled = false; credit.BadLoan = false; credit.AddInstallment(installment1); credit.AddInstallment(installment2); }