protected override void SetUp()
        {
            base.SetUp();

            ChartOfAccounts.SuppressAll();

            _savingManager      = (SavingManager)container["SavingManager"];
            _savingEventManager = (SavingEventManager)container["SavingEventManager"];

            _client = new Person {
                Id = 6
            };
            _user = new User {
                Id = 1
            };
            User.CurrentUser = _user;
            _product         = new SavingsBookProduct
            {
                Id                = 1,
                Name              = "SavingProduct1",
                InitialAmountMin  = 100,
                InitialAmountMax  = 500,
                BalanceMin        = 0,
                BalanceMax        = 1000,
                WithdrawingMin    = 100,
                WithdrawingMax    = 150,
                DepositMin        = 200,
                DepositMax        = 250,
                TransferMin       = 100,
                TransferMax       = 200,
                InterestRateMin   = 0.2,
                InterestRateMax   = 0.3,
                InterestBase      = OSavingInterestBase.Daily,
                InterestFrequency = OSavingInterestFrequency.EndOfMonth,
                Currency          = new Currency {
                    Id = 1
                },
                WithdrawFeesType = OSavingsFeesType.Flat,
                FlatWithdrawFees = 10,
                TransferFeesType = OSavingsFeesType.Rate,
                RateTransferFees = 0.1
            };

            _saving = new SavingBookContract(ApplicationSettings.GetInstance(""), _user, new DateTime(2009, 01, 01), _product, null)
            {
                Code             = "S/CR/2009/SAVIN-1/BAR-1",
                InterestRate     = 0.2,
                FlatWithdrawFees = 10,
                RateTransferFees = 0.1
            };
            _saving.FirstDeposit(1000, new DateTime(2009, 01, 01), null, new User(), Teller.CurrentTeller);

            _savingTarget = _saving = new SavingBookContract(ApplicationSettings.GetInstance(""), _user, new DateTime(2009, 01, 01), _product, null)
            {
                Code         = "S/CR/2009/SAVIN-1/BAR-2",
                InterestRate = 0.2,
            };

            _saving.InitialAmount   = 1000;
            _saving.EntryFees       = 10;
            _saving.SavingsOfficer  = _user;
            _saving.NumberOfPeriods = 0;
            _saving.Id       = _savingManager.Add(_saving, _client);
            _savingTarget.Id = _savingManager.Add(_savingTarget, _client);

            Branch branch = new Branch {
                Id = 1, Name = "Default", Code = "Default"
            };

            _saving.Branch       = branch;
            _savingTarget.Branch = branch;
        }
Esempio n. 2
0
 public void TestFixtureSetUp()
 {
     ApplicationSettings.GetInstance("").DeleteAllParameters();
     ChartOfAccounts.SuppressAll();
 }