Exemplo n.º 1
0
 public UserServices(UserManager pUserManager)
 {
     _userManager = pUserManager;
     _tellerManager = new TellerManager();
     roleServices = ServicesProvider.GetInstance().GetRoleServices();
     branchServices = ServicesProvider.GetInstance().GetBranchService();
 }
Exemplo n.º 2
0
 public UserServices(User pUser, string pTestDb)
 {
     _userManager = new UserManager(pTestDb);
     _tellerManager = new TellerManager(pTestDb);
     roleServices = ServicesProvider.GetInstance().GetRoleServices();
     branchServices = ServicesProvider.GetInstance().GetBranchService();
 }
Exemplo n.º 3
0
 public TellerManager()
 {
     accountManager = new AccountManager();
     branchManager = new BranchManager();
     userManager = new UserManager();
     currencyManager = new CurrencyManager();
 }
Exemplo n.º 4
0
 public TellerManager(string pTestDb)
     : base(pTestDb)
 {
     accountManager = new AccountManager(pTestDb);
     branchManager = new BranchManager(pTestDb);
     userManager = new UserManager(pTestDb);
     currencyManager = new CurrencyManager(pTestDb);
 }
Exemplo n.º 5
0
 public TellerManager(User user)
     : base(user)
 {
     accountManager = new AccountManager(user);
     branchManager = new BranchManager(user);
     userManager = new UserManager(user);
     currencyManager = new CurrencyManager(user);
 }
Exemplo n.º 6
0
        public void InitManager()
        {
            TechnicalSettings.CheckSettings();

            LoanProductManager loanProductManager = new LoanProductManager(DataUtil.TESTDB);
            AccountingTransactionManager accountingTransactionManager = new AccountingTransactionManager(DataUtil.TESTDB);
            EventManager eventManager = new EventManager(DataUtil.TESTDB);
            ExchangeRateManager exchangeRateManager = new ExchangeRateManager(DataUtil.TESTDB);
            ProvisioningRuleManager provisioningRuleManager = new ProvisioningRuleManager(DataUtil.TESTDB);
            AccountManager accountManager = new AccountManager(DataUtil.TESTDB);
            InstallmentTypeManager installmentTypeManager = new InstallmentTypeManager(DataUtil.TESTDB);
            UserManager userManager = new UserManager(DataUtil.TESTDB);
            EconomicActivityManager economicActivityManager = new EconomicActivityManager(DataUtil.TESTDB);
            InstallmentManager installmentManager = new InstallmentManager(DataUtil.TESTDB);
            FundingLineManager fundingLineManager = new FundingLineManager(DataUtil.TESTDB);
            ClientManager clientManager = new ClientManager(DataUtil.TESTDB);
            LocationsManager locationsManager = new LocationsManager(DataUtil.TESTDB);
            LoanManager loanManager = new LoanManager(DataUtil.TESTDB);
            ProjectManager projectManager = new ProjectManager(DataUtil.TESTDB);
            MFIManager mfiManager = new MFIManager(DataUtil.TESTDB);
            SavingManager savingManager = new SavingManager(DataUtil.TESTDB);
            SavingProductManager savingProductManager = new SavingProductManager(DataUtil.TESTDB);
            SavingEventManager savingEventManager = new SavingEventManager(DataUtil.TESTDB);
            CurrencyManager currencyManager = new CurrencyManager(DataUtil.TESTDB);
            AccountingRuleManager accountingRuleManager = new AccountingRuleManager(DataUtil.TESTDB);
            FundingLineServices fundingLineServices = new FundingLineServices(DataUtil.TESTDB);

            container = new Hashtable
                            {
                                {"LoanProductManager", loanProductManager},
                                {"AccountingTransactionManager", accountingTransactionManager},
                                {"EventManager", eventManager},
                                {"ExchangeRateManager", exchangeRateManager},
                                {"ProvisioningRuleManager", provisioningRuleManager},
                                {"AccountManager", accountManager},
                                {"InstallmentTypeManager", installmentTypeManager},
                                {"UserManager", userManager},
                                {"FundingLineManager", fundingLineManager},
                                {"LoanManager", loanManager},
                                {"ClientManager", clientManager},
                                {"LocationsManager", locationsManager},
                                {"ProjectManager", projectManager},
                                {"EconomicActivityManager", economicActivityManager},
                                {"InstallmentManager", installmentManager},
                                {"MFIManager", mfiManager},
                                {"SavingManager", savingManager},
                                {"SavingProductManager", savingProductManager},
                                {"SavingEventManager", savingEventManager},
                                {"CurrencyManager", currencyManager},
                                {"FundingLineServices", fundingLineServices},
                                {"AccountingRuleManager", accountingRuleManager}
                            };
        }
        public void AddUserTest()
        {
                        
            var role = new Role
            {
                RoleName = "CASHI",
                Id = 2,
                IsDeleted = false,
                Description = "Cashier role"
            };
                        
            var userManager = new UserManager();
            var user = new User
            {
                FirstName = "Test2",
                LastName = "User2",
                Mail = "[email protected]",
                UserName = "******",
                Password = "******",
                Role = User.Roles.CASHI,
                UserRole = role,
                Phone = "+987654321",
                Sex = 'F'
            };            

            int userId = userManager.AddUser(user);

            var userResult = userManager.SelectUser(userId, true);

            Assert.AreEqual(userId, userResult.Id);
            Assert.AreEqual(user.FirstName, userResult.FirstName);
            Assert.AreEqual(user.LastName, userResult.LastName);
            Assert.AreEqual(user.UserName, userResult.UserName);
            Assert.AreEqual(user.UserRole.Id, userResult.UserRole.Id);
            Assert.AreEqual(user.UserRole.RoleName, userResult.UserRole.RoleName);
            //Assert.AreEqual(user.Password, userResult.Password);
            Assert.AreEqual(user.Mail, userResult.Mail);
            Assert.AreEqual(user.Role, userResult.Role);
            Assert.AreEqual(user.Phone, userResult.Phone);
            Assert.AreEqual(user.Sex, userResult.Sex);



        }
        public void TestSearchContractInDatabaseWithUserIdSetAndUserLastNameAndFirstNameNull()
        {
            ApplicationSettings dataParam = ApplicationSettings.GetInstance("");
            dataParam.DeleteAllParameters();
            dataParam.AddParameter(OGeneralSettings.LOANOFFICERPORTFOLIOFILTER, false);
            dataParam.AddParameter(OGeneralSettings.ACCOUNTINGPROCESS, OAccountingProcesses.Cash);
            dataParam.AddParameter(OGeneralSettings.USECENTS, true);

            UserManager userManager = new UserManager(DataUtil.TESTDB);
            User loanOfficer = new User();
            loanOfficer.UserName = "******";
            loanOfficer.Password = "******";
            loanOfficer.Role = User.Roles.LOF;
            loanOfficer.Mail = "Not Set";
            loanOfficer.Id = userManager.AddUser(loanOfficer);
            credit.LoanOfficer = loanOfficer;
            FundingLine fund = new FundingLine();
            fund.Purpose = "Microsoft financement";
            fund.Name = "AFD130";
            fund.Deleted = false;
            fund.StartDate = DateTime.Now;
            fund.EndDate = DateTime.Now;
            fund.Currency = new Currency { Id = 1 };
            fundingLineManager.AddFundingLine(fund, null);
            credit.FundingLine = fund;
            creditManagement.AddCredit(credit, _project.Id, null);
            List<CreditSearchResult> ds = creditManagement.SearchCreditInDatabase(1, "G");
            Assert.AreEqual(1, ds.Count);
            Assert.AreEqual("lo", ds[0].LoanOfficerName);
        }
        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);
        }
Exemplo n.º 10
0
 public UserServices(UserManager pUserManager)
 {
     _user = new User();
     _userManager = pUserManager;
     _tellerManager = new TellerManager("");
 }
Exemplo n.º 11
0
 public UserServices(User pUser, string pTestDb)
 {
     _user = pUser;
     _userManager = new UserManager(pTestDb, pUser);
     _tellerManager = new TellerManager(pTestDb);
 }
Exemplo n.º 12
0
 public DataHelper()
 {
     _domainOfApplicationManagement = new EconomicActivityManager(DataUtil.TESTDB);
     _userManager = new UserManager(DataUtil.TESTDB);
 }
Exemplo n.º 13
0
 protected override void SetUp()
 {
     base.SetUp();
     _userManager = (UserManager)container["UserManager"];
 }