public void Charge_agio_fees() { SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(), new DateTime(2009, 01, 01), null) { Product = _bookProduct, AgioFees = 0.01, ChequeDepositFees = 100, DepositFees = 50, CloseFees = 100, ReopenFees = 100, OverdraftFees = 100 }; saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller); Currency currency = new Currency() { UseCents = true, Code = "SOM", Id = 1, IsPivot = true, Name = "SOM" }; Assert.AreEqual(1000, saving.GetBalance().Value); //Below, we explicitly implement withdraw method from <Saving services>.<Withdraw>, since withdraw method of 'saving' object doesn't implement // overdraft fee by default List <SavingEvent> withdrawEvents = saving.Withdraw(1100, new DateTime(2009, 1, 2), "withdraw", new User(), false, null); saving.Closure(new DateTime(2009, 1, 12), new User()); //agio for ten days Assert.AreEqual(-111.55, saving.GetBalance().Value); }
public void NoMgmtFeeEvent() { _saving.AgioFees = 0.1; _saving.Closure(new DateTime(2007, 8, 30), new User()); List <SavingEvent> events = _saving.Events.FindAll(item => item is SavingManagementFeeEvent); Assert.AreEqual(events.Count, 0); }
public void SeveralMgmtFeeEvents() { _saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(), new DateTime(2007, 08, 11), _bookProduct, null); _saving.AgioFees = 0.1; _saving.ManagementFees = 50; _saving.FirstDeposit(10000, new DateTime(2007, 08, 01), null, new User(), Teller.CurrentTeller); _saving.Closure(new DateTime(2007, 12, 31), new User()); List <SavingEvent> events = _saving.Events.FindAll(item => item is SavingManagementFeeEvent); Assert.AreEqual(events.Count, 4); Assert.AreEqual(9800, _saving.GetBalance().Value); }
public void UpdateAccountsBalanceSaving() { Assert.Ignore(); // Ru55 SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User() { Id = 1 }, new DateTime(2009, 01, 01), _savingsBookProduct, null) { Code = "S/CR/2009/SAVIN-1/BAR-2", Status = OSavingsStatus.Active, InterestRate = 0.01, FlatWithdrawFees = 3, FlatTransferFees = 3, AgioFees = 0.1 }; saving.Events[0].User = new User() { Id = 1 }; saving.Id = _savingManager.Add(saving, new Person { Id = 6 }); saving = (SavingBookContract)_savingManager.Select(saving.Id); saving.Closure(new DateTime(2009, 02, 01), new User { Id = 1 }); saving.Withdraw(50, new DateTime(2009, 02, 01), "testWithdraw", new User { Id = 1 }, false, null, new PaymentMethod()); saving.Closure(new DateTime(2010, 01, 01), new User { Id = 1 }); SavingBookContract retrievedSaving = (SavingBookContract)_savingManager.Select(saving.Id); }
public void CalculateInterest_AccrualhMode_Daily_EndOfYear_OneClosure_AfterOneWeek_Agio() { Assert.Ignore(); ApplicationSettings.GetInstance("").UpdateParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Accrual); _bookProduct.InterestFrequency = OSavingInterestFrequency.EndOfYear; SavingBookContract saving = new SavingBookContract(ApplicationSettings.GetInstance(""), new User(), new DateTime(2009, 01, 01), null) { Product = _bookProduct, InterestRate = 0.1, AgioFees = 0.1 }; saving.Closure(new DateTime(2009, 01, 08), new User() { Id = 1 }); int accrualEvents = saving.Events.FindAll(item => item is SavingInterestsAccrualEvent).Count; int postingEvents = saving.Events.FindAll(items => items is SavingInterestsPostingEvent).Count; List <SavingEvent> agioEvents = saving.Events.FindAll(items => items is SavingAgioEvent); Assert.AreEqual(agioEvents.Count, 7); Assert.AreEqual(agioEvents[0].Fee, 10); Assert.AreEqual(saving.GetBalance(), -170); // saving.Deposit(200, new DateTime(2009, 01, 08), "depot", new User(), false, false, OPaymentMethods.Cash, null, null); saving.Deposit(200, new DateTime(2009, 01, 08), "depot", new User(), false, false, OSavingsMethods.Cash, null, null); //saving.Withdraw(230, new DateTime(2009, 02, 03), "retrait", new User(), false); saving.Closure(new DateTime(2009, 01, 15), new User() { Id = 1 }); List <SavingEvent> agioEvents2 = saving.Events.FindAll(items => items is SavingAgioEvent); Assert.AreEqual(agioEvents2.Count, 13); Assert.AreEqual(agioEvents2[9].Fee, 13); Assert.AreEqual(saving.GetBalance(), -51); }