예제 #1
0
        public void TestFixtureSetUp()
        {
            _user       = new User();
            _provisions = ProvisionTable.GetInstance(_user);
            _provisions.Add(new ProvisioningRate {
                Number = 1, NbOfDaysMin = 0, NbOfDaysMax = 30, Rate = 10
            });
            _provisions.Add(new ProvisioningRate {
                Number = 2, NbOfDaysMin = 31, NbOfDaysMax = 60, Rate = 25
            });
            _provisions.Add(new ProvisioningRate {
                Number = 3, NbOfDaysMin = 61, NbOfDaysMax = 90, Rate = 50
            });
            _provisions.Add(new ProvisioningRate {
                Number = 4, NbOfDaysMin = 91, NbOfDaysMax = 180, Rate = 75
            });
            _provisions.Add(new ProvisioningRate {
                Number = 5, NbOfDaysMin = 181, NbOfDaysMax = 365, Rate = 100
            });
            _provisions.Add(new ProvisioningRate {
                Number = 6, NbOfDaysMin = 366, NbOfDaysMax = 99999, Rate = 100
            });
            _daysOff             = NonWorkingDateSingleton.GetInstance("");
            _daysOff.WeekEndDay1 = 6;
            _daysOff.WeekEndDay2 = 0;
            ApplicationSettings settings = ApplicationSettings.GetInstance("");

            settings.DeleteAllParameters();
            settings.AddParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
            settings.AddParameter(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, false);
            settings.AddParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            settings.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            settings.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
        }
        public void TestFixtureSetUp()
        {
            ProvisionTable provisionTable = ProvisionTable.GetInstance(new User());

            provisionTable.Add(new ProvisioningRate {
                Number = 1, NbOfDaysMin = 0, NbOfDaysMax = 30, ProvisioningValue = 10, ProvisioningInterest = 10, ProvisioningPenalty = 10
            });
            provisionTable.Add(new ProvisioningRate {
                Number = 2, NbOfDaysMin = 31, NbOfDaysMax = 60, ProvisioningValue = 25, ProvisioningInterest = 25, ProvisioningPenalty = 25
            });
            provisionTable.Add(new ProvisioningRate {
                Number = 3, NbOfDaysMin = 61, NbOfDaysMax = 90, ProvisioningValue = 50, ProvisioningInterest = 50, ProvisioningPenalty = 50
            });
            provisionTable.Add(new ProvisioningRate {
                Number = 4, NbOfDaysMin = 91, NbOfDaysMax = 180, ProvisioningValue = 75, ProvisioningInterest = 75, ProvisioningPenalty = 75
            });
            provisionTable.Add(new ProvisioningRate {
                Number = 5, NbOfDaysMin = 181, NbOfDaysMax = 365, ProvisioningValue = 100, ProvisioningInterest = 100, ProvisioningPenalty = 100
            });
            provisionTable.Add(new ProvisioningRate {
                Number = 6, NbOfDaysMin = 366, NbOfDaysMax = 99999, ProvisioningValue = 100, ProvisioningInterest = 100, ProvisioningPenalty = 100
            });
            nonWorkingDateHelper                = NonWorkingDateSingleton.GetInstance("");
            nonWorkingDateHelper.WeekEndDay1    = 6;
            nonWorkingDateHelper.WeekEndDay2    = 0;
            nonWorkingDateHelper.PublicHolidays = new Dictionary <DateTime, string>();
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 1, 1), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 12, 25), "Christmas");
            dataParam = ApplicationSettings.GetInstance("");
            dataParam.DeleteAllParameters();
            dataParam.AddParameter(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, true);
            dataParam.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            dataParam.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
        }
        public void TestFixtureTearDown()
        {
            ApplicationSettings generalParameters = ApplicationSettings.GetInstance("");

            generalParameters.DeleteAllParameters();
            generalParameters.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            generalParameters.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
        }
예제 #4
0
        private static ApplicationSettings GetDataBaseParam(int groupMinMembers, bool cityMandatory)
        {
            ApplicationSettings dataParam = ApplicationSettings.GetInstance("");

            dataParam.DeleteAllParameters();
            dataParam.AddParameter(OGeneralSettings.GROUPMINMEMBERS, 4);
            dataParam.AddParameter(OGeneralSettings.GROUPMAXMEMBERS, 10);
            return(dataParam);
        }
        public void TestFixtureSetUp()
        {
            ApplicationSettings generalParameters = ApplicationSettings.GetInstance("");

            generalParameters.DeleteAllParameters();
            generalParameters.AddParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            generalParameters.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            generalParameters.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
            generalParameters.AddParameter(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, true);
            generalParameters.AddParameter(OGeneralSettings.STOP_WRITEOFF_PENALTY, true);
        }
        public void TestFixtureSetUp()
        {
            nonWorkingDateHelper                = NonWorkingDateSingleton.GetInstance("");
            nonWorkingDateHelper.WeekEndDay1    = 6;
            nonWorkingDateHelper.WeekEndDay2    = 0;
            nonWorkingDateHelper.PublicHolidays = new Dictionary <DateTime, string>();
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 1, 1), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 3, 8), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 3, 21), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 3, 22), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 5, 1), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 5, 9), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 6, 27), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 9, 9), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 11, 6), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 11, 26), "New Year Eve");
            nonWorkingDateHelper.PublicHolidays.Add(new DateTime(2006, 1, 6), "Christmas");

            ApplicationSettings generalParameters = ApplicationSettings.GetInstance("");

            generalParameters.DeleteAllParameters();
            generalParameters.AddParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            generalParameters.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            generalParameters.AddParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
            generalParameters.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
            generalParameters.AddParameter(OGeneralSettings.INTEREST_RATE_DECIMAL_PLACES, 2);
            generalParameters.AddParameter(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, true);
            generalParameters.AddParameter(OGeneralSettings.STOP_WRITEOFF_PENALTY, true);
            generalParameters.AddParameter(OGeneralSettings.USE_DAILY_ACCRUAL_OF_PENALTY, false);
        }
        public void testFixtureTearDown()
        {
            ApplicationSettings generalParameters = ApplicationSettings.GetInstance("");

            generalParameters.DeleteAllParameters();
            generalParameters.AddParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
        }
예제 #8
0
        public void TestFixtureSetUp()
        {
            TechnicalSettings.UseOnlineMode = false;
            nonWorkingDateManager           = new NonWorkingDateManagement(DataUtil.TESTDB);

            nonWorkingDateManager.DeleteAllPublicHolidays();

            nonWorkingDateManager.AddPublicHoliday(new DictionaryEntry(new DateTime(2006, 1, 1), "New Year Eve"));
            nonWorkingDateManager.AddPublicHoliday(new DictionaryEntry(new DateTime(2006, 3, 21), "Idi Navruz"));
            nonWorkingDateManager.AddPublicHoliday(new DictionaryEntry(new DateTime(2006, 11, 6), "Idi Ramazan"));

            ApplicationSettings data = ApplicationSettings.GetInstance("");

            data.DeleteAllParameters();
            data.AddParameter(OGeneralSettings.WEEKENDDAY1, 6);
            data.AddParameter(OGeneralSettings.WEEKENDDAY2, 0);
        }
예제 #9
0
        public void SetUp()
        {
            ChartOfAccounts.GetInstance(new User()).Accounts.Clear();
            ApplicationSettings dataParam = ApplicationSettings.GetInstance("");

            dataParam.DeleteAllParameters();
            dataParam.AddParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
        }
예제 #10
0
        public void SetUp()
        {
            _accountingRuleManagerMock = new DynamicMock(typeof(AccountingRuleManager));
            _accountingRuleServices    = new AccountingRuleServices((AccountingRuleManager)_accountingRuleManagerMock.MockInstance);

            NonWorkingDateSingleton holidays = NonWorkingDateSingleton.GetInstance("");

            holidays.WeekEndDay1    = 6;
            holidays.WeekEndDay2    = 0;
            holidays.PublicHolidays = new Dictionary <DateTime, string>
            {
                { new DateTime(2011, 1, 1), "New Year Eve" },
                { new DateTime(2011, 12, 25), "Christmas" }
            };
            ApplicationSettings generalSettings = ApplicationSettings.GetInstance("");

            generalSettings.DeleteAllParameters();
            generalSettings.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            generalSettings.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
            generalSettings.AddParameter(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, true);
            generalSettings.AddParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            generalSettings.AddParameter(OGeneralSettings.BAD_LOAN_DAYS, 50);
            generalSettings.AddParameter(OGeneralSettings.STOP_WRITEOFF_PENALTY, true);
            generalSettings.AddParameter(OGeneralSettings.USE_DAILY_ACCRUAL_OF_PENALTY, false);
        }
예제 #11
0
        public void Test_AccruedInterestProcessingCeaseDays()
        {
            ApplicationSettings generalSettings = ApplicationSettings.GetInstance("");

            generalSettings.DeleteAllParameters();
            generalSettings.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            generalSettings.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
            generalSettings.AddParameter(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, true);
            generalSettings.AddParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            generalSettings.AddParameter(OGeneralSettings.BAD_LOAN_DAYS, 50);
            generalSettings.AddParameter(OGeneralSettings.CEASE_LAIE_DAYS, 10);
            generalSettings.AddParameter(OGeneralSettings.USE_DAILY_ACCRUAL_OF_PENALTY, false);

            Loan myContract = _SetContract(6000, 0.0833m, OLoanTypes.Flat,
                                           new NonRepaymentPenalties(0, 0, 0, 0), false, 0,
                                           new DateTime(2010, 10, 15), 3);

            OpenCBS.CoreDomain.Contracts.Loans.LoanRepayment.Repayment.RepayLateInstallments.CalculateInstallments rLi =
                _SetRepaymentOptions(myContract, false);

            Assert.AreEqual(new DateTime(2010, 11, 15), myContract.GetInstallment(0).ExpectedDate);
            Assert.AreEqual(new DateTime(2010, 12, 15), myContract.GetInstallment(1).ExpectedDate);

            RepaymentEvent rpeEvent = myContract.Repay(1, new DateTime(2010, 11, 15), 2500, false, true);

            Assert.AreEqual(rpeEvent.Interests, 500m);
            rpeEvent = myContract.Repay(2, new DateTime(2010, 12, 10), 300, false, true);
            Assert.AreEqual(rpeEvent.Interests, 300);

            AccruedInterestEvent e = myContract.GetAccruedInterestEvent(new DateTime(2010, 12, 31));

            Assert.AreEqual(e.Code, "LIAE");
            Assert.AreEqual(e.AccruedInterest, 1151);
            myContract.Events.Add(e);
        }
        public void TestFixtureSetUp()
        {
            NonWorkingDateSingleton holidays = NonWorkingDateSingleton.GetInstance("");

            holidays.WeekEndDay1    = 6;
            holidays.WeekEndDay2    = 0;
            holidays.PublicHolidays = new Dictionary <DateTime, string>
            {
                { new DateTime(2006, 1, 1), "New Year Eve" },
                { new DateTime(2006, 12, 25), "Christmas" }
            };
            ApplicationSettings generalSettings = ApplicationSettings.GetInstance("");

            generalSettings.DeleteAllParameters();
            generalSettings.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            generalSettings.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
            generalSettings.AddParameter(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, true);
            generalSettings.AddParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
        }
예제 #13
0
        public void TestSaveGroupWhenCityIsNotMandatory()
        {
            AddDataForTestingTransaction addDataForTesting = new AddDataForTestingTransaction();
            clientManagement = new ClientManager(DataUtil.TESTDB);
            clientServices = new ClientServices(clientManagement);
            branchManager = new BranchManager(DataUtil.TESTDB);
            //List<Branch> branchs = branchManager.SelectAll();

            ApplicationSettings dataParam = ApplicationSettings.GetInstance("");
            dataParam.DeleteAllParameters();
            dataParam.AddParameter(OGeneralSettings.GROUPMINMEMBERS, 4);
            dataParam.AddParameter(OGeneralSettings.GROUPMAXMEMBERS, 10);
            dataParam.AddParameter(OGeneralSettings.CITYMANDATORY, false);
            DeleteAllData();

            Person leader = addDataForTesting.AddPerson();
            Person members = addDataForTesting.AddPersonBis();
            Person membersTer = addDataForTesting.AddPersonTer();
            Person membersQuater = addDataForTesting.AddPersonQuater();
            Group group = new Group
                              {
                                  Active = true,
                                  City = null,
                                  District = leader.District,
                                  Name = "SCG",
                                  Leader = new Member { Tiers = leader, LoanShareAmount = 1000, CurrentlyIn = true, IsLeader = true, JoinedDate = TimeProvider.Today },
                                  LoanCycle = 3,
                                  Branch = _branch
                              };

            group.AddMember(new Member { Tiers = members, LoanShareAmount = 200, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
            group.AddMember(new Member { Tiers = membersTer, LoanShareAmount = 400, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });
            group.AddMember(new Member { Tiers = membersQuater, LoanShareAmount = 700, CurrentlyIn = true, IsLeader = false, JoinedDate = TimeProvider.Today });

            Assert.AreEqual(String.Empty, clientServices.SaveSolidarityGroup(ref group));
        }
예제 #14
0
        public static void BeforeTestRun()
        {
            SetupHolidays();
            Settings.AddParameter("INCREMENTAL_DURING_DAYOFFS", true);
            Settings.AddParameter("DONOT_SKIP_WEEKENDS_IN_INSTALLMENTS_DATE", false);
            Settings.AddParameter("USE_CENTS", false);
            Settings.AddParameter("PAY_FIRST_INSTALLMENT_REAL_VALUE", true);
            Settings.AddParameter("ALIGN_INSTALLMENTS_ON_REAL_DISBURSEMENT_DATE", false);
            Settings.AddParameter("WEEK_END_DAY1", 6);
            Settings.AddParameter("WEEK_END_DAY2", 0);

            NonWorkingDays.WeekEndDay1 = 6;
            NonWorkingDays.WeekEndDay2 = 0;

            _configurationFactory = new OctopusScheduleConfigurationFactory(NonWorkingDays);

            _cultureInfo = new CultureInfo("ru-RU");
        }
예제 #15
0
        public void SetUp()
        {
            ApplicationSettings dataParam = ApplicationSettings.GetInstance("");

            dataParam.DeleteAllParameters();
            dataParam.AddParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);

            Currency currency = new Currency()
            {
                UseCents = true, Code = "SOM", Id = 1, IsPivot = true, Name = "SOM"
            };

            _bookProduct = new SavingsBookProduct
            {
                CalculAmountBase = OSavingCalculAmountBase.MinimalAmount,
                Id                = 1,
                InterestBase      = OSavingInterestBase.Daily,
                InterestFrequency = OSavingInterestFrequency.EndOfWeek,
                ManagementFeeFreq = new InstallmentType
                {
                    Id         = 1,
                    Name       = "Monthly",
                    NbOfDays   = 0,
                    NbOfMonths = 1
                },
                AgioFeesFreq = new InstallmentType
                {
                    Id         = 2,
                    Name       = "Daily",
                    NbOfDays   = 1,
                    NbOfMonths = 0
                },
                WithdrawFeesType = OSavingsFeesType.Flat,
                FlatWithdrawFees = 0,
                Currency         = currency
            };

            _saving = new SavingBookContract(ApplicationSettings.GetInstance(""),
                                             new User(),
                                             new DateTime(2007, 08, 11), _bookProduct, null);
        }
예제 #16
0
        public void TestFixtureSetUp()
        {
            _generalSettings = ApplicationSettings.GetInstance("");
            _generalSettings.DeleteAllParameters();
            _generalSettings.AddParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            _generalSettings.AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            _generalSettings.AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);
            _generalSettings.AddParameter(OGeneralSettings.PAYFIRSTINSTALLMENTREALVALUE, true);
            _generalSettings.AddParameter(OGeneralSettings.BAD_LOAN_DAYS, "180");
            _generalSettings.AddParameter(OGeneralSettings.STOP_WRITEOFF_PENALTY, true);
            _generalSettings.AddParameter(OGeneralSettings.USE_DAILY_ACCRUAL_OF_PENALTY, false);

            _provisionningTable = ProvisionTable.GetInstance(new User());
            _provisionningTable.ProvisioningRates = new List <ProvisioningRate>();
            _provisionningTable.Add(new ProvisioningRate {
                Number = 1, NbOfDaysMin = 0, NbOfDaysMax = 30, ProvisioningValue = 10
            });
            _provisionningTable.Add(new ProvisioningRate {
                Number = 2, NbOfDaysMin = 31, NbOfDaysMax = 60, ProvisioningValue = 25
            });
            _provisionningTable.Add(new ProvisioningRate {
                Number = 3, NbOfDaysMin = 61, NbOfDaysMax = 90, ProvisioningValue = 50
            });
            _provisionningTable.Add(new ProvisioningRate {
                Number = 4, NbOfDaysMin = 91, NbOfDaysMax = 180, ProvisioningValue = 75
            });
            _provisionningTable.Add(new ProvisioningRate {
                Number = 5, NbOfDaysMin = 181, NbOfDaysMax = 365, ProvisioningValue = 100
            });
            _provisionningTable.Add(new ProvisioningRate {
                Number = 6, NbOfDaysMin = 366, NbOfDaysMax = 99999, ProvisioningValue = 100
            });

            _nonWorkingDate = NonWorkingDateSingleton.GetInstance("");
            _nonWorkingDate.PublicHolidays = new Dictionary <DateTime, string>();
            _nonWorkingDate.WeekEndDay1    = 0;
            _nonWorkingDate.WeekEndDay2    = 1;
        }
예제 #17
0
 public void TestFixtureSetup()
 {
     _settings = ApplicationSettings.GetInstance(string.Empty);
     _settings.AddParameter("DONOT_SKIP_WEEKENDS_IN_INSTALLMENTS_DATE", false);
     _settings.AddParameter("INCREMENTAL_DURING_DAYOFFS", false);
 }
예제 #18
0
 public void GetAccountingProcess_Cash()
 {
     dbParam.DeleteAllParameters();
     dbParam.AddParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
     Assert.AreEqual(OAccountingProcesses.Cash, dbParam.AccountingProcesses);
 }