public void TestWriteOffEventAccruedPenalties() { WriteOffEvent wROE = new WriteOffEvent(); wROE.AccruedPenalties = 3456.1m; Assert.AreEqual(3456.1m, wROE.AccruedPenalties.Value); }
public void TestWriteOffEventOutstandingAmount() { WriteOffEvent wROE = new WriteOffEvent(); wROE.OLB = 3456.1m; Assert.AreEqual(3456.1m, wROE.OLB.Value); }
public void TestWriteOffEventAccruedInterests() { WriteOffEvent wROE = new WriteOffEvent(); wROE.AccruedInterests = 3456.1m; Assert.AreEqual(3456.1m, wROE.AccruedInterests.Value); }
private static OCurrency GetValue(WriteOffEvent eventItem, ContractAccountingRule rule) { OCurrency amount = 0; switch (rule.EventAttribute.Name.ToLower()) { case "olb": amount = eventItem.OLB; break; case "accrued_interests": amount = eventItem.AccruedInterests; break; case "accrued_penalties": amount = eventItem.AccruedPenalties; break; case "past_due_days": amount = eventItem.PastDueDays; break; case "overdue_principal": amount = eventItem.OverduePrincipal; break; } return(amount); }
public void Select_Added_WriteOffEvent() { EventManager eventManager = (EventManager)container["EventManager"]; WriteOffEvent writeOffEvent = new WriteOffEvent { Id = 15, User = new User { Id = 1 }, Date = new DateTime(2006, 7, 21), OLB = 34, AccruedInterests = 355, AccruedPenalties = 433, PastDueDays = 3, OverduePrincipal = 0 }; eventManager.AddLoanEvent(writeOffEvent, 1); EventStock eventStock = eventManager.SelectEvents(2); foreach (Event e in eventStock.GetEvents()) { if (e is WriteOffEvent) _AssertWriteOffEvent(e as WriteOffEvent, new DateTime(2006, 7, 21), 34, 355, 433, 3); } }
private static void _AssertWriteOffEvent(WriteOffEvent pEvent, DateTime pDate, OCurrency pOLB, OCurrency pAccruedInterests, OCurrency pAccruedPenalties, int pPastDueDays) { Assert.AreEqual("WROE", pEvent.Code); Assert.AreEqual(pDate, pEvent.Date); Assert.AreEqual(pPastDueDays, pEvent.PastDueDays); Assert.AreEqual(pOLB.Value, pEvent.OLB.Value); Assert.AreEqual(pAccruedInterests.Value, pEvent.AccruedInterests.Value); Assert.AreEqual(pAccruedPenalties.Value, pEvent.AccruedPenalties.Value); }
public void Add_WriteOffEvent() { EventManager eventManager = (EventManager)container["EventManager"]; WriteOffEvent writeOffEvent = new WriteOffEvent { Id = 15, User = new User { Id = 1 }, Date = new DateTime(2006, 7, 21), OLB = 34, AccruedInterests = 355, AccruedPenalties = 433, PastDueDays = 3, OverduePrincipal = 0 }; eventManager.AddLoanEvent(writeOffEvent, 1); Assert.AreNotEqual(0, writeOffEvent.Id); }
private void WriteOffOrigination(WriteOffEvent writeOffEvent, Loan loanContract, SqlTransaction sqlTransac) { _eventManagement.AddLoanEvent(writeOffEvent, loanContract.Id, sqlTransac); }
public void TestIfWriteOffEventCodeCorrectlySetAndRetrieved() { WriteOffEvent wROE = new WriteOffEvent(); Assert.AreEqual("WROE", wROE.Code); }
/// <summary> /// This method sets contract to write off. The loan is definitely considered to loss when the loan is bad for more /// than 1 year. /// </summary> /// <param name="oNdate"></param> /// <returns>A WriteOffEvent or null if : /// - past due days is lower than 365 days /// - no PastDueLoanEvent with past due days greater than 180 days were fired before /// - loan has already been degraded to loan loss /// </returns> public WriteOffEvent WriteOff(DateTime oNdate) { if (!_writtenOff) { _writtenOff = true; ContractStatus = OContractStatus.WrittenOff; WriteOffEvent wOe = new WriteOffEvent { Date = oNdate, ClientType = _clientType, OLB = CalculateActualOlb(), PastDueDays = _CalculatePastDue(oNdate), AccruedInterests = GetUnpaidInterest(oNdate), AccruedPenalties = GetUnpaidLatePenalties(oNdate), IsFired = false, Cancelable = true }; Events.Add(wOe); return wOe; } return null; }