public void TestClosureEventWithCurrency()
        {
            EventStock eventStock = new EventStock
            {
                new LoanDisbursmentEvent
                {
                    Id            = 1,
                    Date          = new DateTime(2000, 1, 1),
                    Amount        = 100,
                    PaymentMethod = new PaymentMethod {
                        Id = 0
                    },
                    ClientType       = OClientTypes.Person,
                    EconomicActivity = new EconomicActivity(1, "Agriculture", null, false),
                    Currency         = new Currency {
                        Id = 1
                    }
                },
                new RepaymentEvent
                {
                    Id          = 2,
                    Principal   = 100,
                    Interests   = 5,
                    Penalties   = 1,
                    Commissions = 0,
                    Date        = new DateTime(2000, 1, 1),
                    Currency    = new Currency {
                        Id = 1
                    },
                    ClientType = OClientTypes.Person
                },
            };

            eventStock.GetRepaymentEvents()[0].LoanProduct = new LoanProduct
            {
                Id       = 2,
                Code     = "EDE60",
                Name     = "EDEN 60",
                Currency = new Currency {
                    Id = 1
                }
            };
            AccountingClosure closure = new AccountingClosure();
            List <FiscalYear> fYears  = new List <FiscalYear> {
                new FiscalYear {
                    OpenDate = new DateTime(1900, 1, 1)
                }
            };
            List <Booking> bookings = closure.GetBookings(_rules, eventStock, null, null, null, fYears);

            Assert.AreEqual(bookings[0].Amount, 100);
            Assert.AreEqual(bookings[0].DebitAccount.Number, "1052");
            Assert.AreEqual(bookings[0].CreditAccount.Number, "1020");
        }
Example #2
0
 public void GetRepaymentEvents()
 {
     Assert.AreEqual(3, _eventStock.GetRepaymentEvents().Count);
 }