Пример #1
0
 public static void KillSingleton()
 {
     Standard.KillSingleton();
     _theUniqueInstance = null;
 }
        public void TestFixtureSetUp()
        {
            ProvisioningTable.GetInstance(new User()).Add(new ProvisioningRate { Number = 1, NbOfDaysMin = 0, NbOfDaysMax = 1000, Rate = 0 });
            ApplicationSettings.GetInstance("").DeleteAllParameters();
            ApplicationSettings.GetInstance("").AddParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
            ApplicationSettings.GetInstance("").AddParameter(OGeneralSettings.USECENTS, true);

            ApplicationSettings.GetInstance("").AddParameter(OGeneralSettings.CALCULATIONLATEFEESDURINGPUBLICHOLIDAYS, true);
            ApplicationSettings.GetInstance("").AddParameter(OGeneralSettings.DONOTSKIPWEEKENDSININSTALLMENTSDATE, false);
            ApplicationSettings.GetInstance("").AddParameter(OGeneralSettings.INCREMENTALDURINGDAYOFF, true);

            TechnicalSettings.UseOnlineMode = false;

            projectManager = new ProjectManager(DataUtil.TESTDB);
            creditManagement = new CreditContractManagement(DataUtil.TESTDB);
            installmentManagement = new InstallmentManager(DataUtil.TESTDB);
            clientManagement = new ClientManager(DataUtil.TESTDB);
            connectionManager = ConnectionManager.GetInstance(DataUtil.TESTDB);
            fundingLineManager = new FundingLineManager(DataUtil.TESTDB);
            userManager = new UserManager(DataUtil.TESTDB);
            _packageManager = new LoanProductManager(DataUtil.TESTDB);

            installment1 = new Installment();
            installment1.Number = 1;
            installment1.CapitalRepayment = 200;
            installment1.InterestsRepayment = 100;
            installment1.PaidCapital = 200;
            installment1.PaidInterests = 100;
            //to initialize Installment.FeesUnpaid, ocurrency is an object, must be initialized
            installment1.FeesUnpaid = 0;
            installment1.ExpectedDate = DateTime.Today.AddDays(-1);

            installment2 = new Installment();
            installment2.Number = 2;
            installment2.CapitalRepayment = 200;
            installment2.InterestsRepayment = 100;
            installment2.PaidCapital = 0;
            installment2.PaidInterests = 100;
            //to initialize Installment.FeesUnpaid, ocurrency is an object, must be initialized
            installment2.FeesUnpaid = 0;
            installment2.ExpectedDate = DateTime.Today.AddMonths(1);
        }
Пример #3
0
 public static ConnectionManager GetInstance(string pLogin, string pPassword, string pServer, string pDatabase, string pTimeout)
 {
     return _theUniqueInstance ?? (_theUniqueInstance = new ConnectionManager(pLogin, pPassword, pServer, pDatabase, pTimeout));
 }
Пример #4
0
 public static ConnectionManager GetInstance(string pTestDb)
 {
     return _theUniqueInstance ?? (_theUniqueInstance = new ConnectionManager(pTestDb));
 }
Пример #5
0
 protected Manager(User pUser)
 {
     _md5 = pUser.Md5;
     _connectionManager = ConnectionManager.GetInstance();
 }
Пример #6
0
 public static ConnectionManager GetInstance()
 {
     return _theUniqueInstance ?? (_theUniqueInstance = new ConnectionManager());
 }
Пример #7
0
 protected Manager()
 {
     _connectionManager = ConnectionManager.GetInstance();
 }
Пример #8
0
 protected Manager(string pDatabaseConnectionString)
 {
     _connectionManager = ConnectionManager.GetInstance(pDatabaseConnectionString);
 }
Пример #9
0
 // MOCK
 public ClientServices(ClientManager clientManagement)
 {
     _clientManagement = clientManagement;
     _connectionManager = ConnectionManager.GetInstance(TESTDB);
     _dataParam = ApplicationSettings.GetInstance("");
     _picturesServices = new PicturesServices(TESTDB);
     _dataParam.DeleteAllParameters();
     _dataParam.AddParameter("GROUP_MIN_MEMBERS", 4);
     _dataParam.AddParameter("GROUP_MAX_MEMBERS", 10);
     _dataParam.AddParameter(OGeneralSettings.ALLOWSMULTIPLEGROUPS, 0);
     _dataParam.AddParameter("CITY_MANDATORY", true);
 }
Пример #10
0
 // MOCK
 public ClientServices(ClientManager clientManagement, ConnectionManager connectionManager)
 {
     _clientManagement = clientManagement;
     _connectionManager = connectionManager;
 }
Пример #11
0
 // MOCK
 public ClientServices(ApplicationSettings dataParam)
 {
     _clientManagement = new ClientManager(TESTDB);
     _connectionManager = ConnectionManager.GetInstance(TESTDB);
     _picturesServices = new PicturesServices(TESTDB);
     _dataParam = dataParam;
 }
Пример #12
0
 public void TestIfConnectionCorrectlyGetWhenConnectToOctopusTest()
 {
     connectionManager = ConnectionManager.GetInstance(DataUtil.TESTDB);
     Assert.AreEqual(ConnectionState.Open,connectionManager.SqlConnection.State);
     connectionManager.CloseConnection();
 }
Пример #13
0
 public void TestIfConenctionCorrectlyGetWhenConnectWithoutRegistry()
 {
     connectionManager = ConnectionManager.GetInstance("sa", "opencbs", "(local)", "opencbs_test","30");
     Assert.AreEqual(ConnectionState.Open,connectionManager.SqlConnection.State);
     connectionManager.CloseConnection();
 }