Exemplo n.º 1
0
        public void CalculateInterest_OneDay()
        {
            SavingProduct product = new SavingProduct
            {
                Id = 1,
                InterestBase = OSavingInterestBase.Monthly,
                InterestFrequency = OSavingInterestFrequency.EndOfYear,
                CalculAmountBase = OSavingCalculAmountBase.MinimalAmount
            };
            Saving saving = new Saving(ApplicationSettings.GetInstance(""), new User(),
                1000, new DateTime(2009, 07, 01)) { Product = product, InterestRate = 0.1 };

            List<SavingInterestsAccrualEvent> list = new List<SavingInterestsAccrualEvent>();
            list = saving.CalculateInterest(new DateTime(2009, 07, 02), new User { Id = 1 });

            Assert.AreEqual(list.Count, 0);
        }
Exemplo n.º 2
0
 public void Get_Set_InitialAmountMin()
 {
     SavingProduct saving = new SavingProduct { InitialAmountMin = 150m };
     Assert.AreEqual(150m, saving.InitialAmountMin.Value);
 }
Exemplo n.º 3
0
 public void Get_Set_InitialAmountMax()
 {
     SavingProduct saving = new SavingProduct { InitialAmountMax = 300m };
     Assert.AreEqual(300m, saving.InitialAmountMax.Value);
 }
Exemplo n.º 4
0
 public void Get_Set_Id()
 {
     SavingProduct saving = new SavingProduct { Id = 1 };
     Assert.AreEqual(1, saving.Id);
 }
Exemplo n.º 5
0
 public void Get_Set_DepositMin()
 {
     SavingProduct saving = new SavingProduct { DepositMin = 100m };
     Assert.AreEqual(100m, saving.DepositMin.Value);
 }
Exemplo n.º 6
0
 public void Get_Set_DepositMax()
 {
     SavingProduct saving = new SavingProduct { DepositMax = 500m };
     Assert.AreEqual(500m, saving.DepositMax.Value);
 }
Exemplo n.º 7
0
 public void Get_Set_Delete()
 {
     SavingProduct saving = new SavingProduct { Delete = true };
     Assert.IsTrue(saving.Delete);
 }
Exemplo n.º 8
0
 public void Get_Set_InterestFrequency()
 {
     SavingProduct product = new SavingProduct { InterestFrequency = OSavingInterestFrequency.EndOfWeek };
     Assert.AreEqual(OSavingInterestFrequency.EndOfWeek, product.InterestFrequency);
 }
Exemplo n.º 9
0
 public void Get_Set_BalanceMin()
 {
     SavingProduct saving = new SavingProduct { BalanceMin = 150m };
     Assert.AreEqual(150m, saving.BalanceMin.Value);
 }
Exemplo n.º 10
0
 public void Get_Set_BalanceMax()
 {
     SavingProduct saving = new SavingProduct { BalanceMax = 300m };
     Assert.AreEqual(300m, saving.BalanceMax.Value);
 }
Exemplo n.º 11
0
 public void Get_Set_WithdrawingMin()
 {
     SavingProduct saving = new SavingProduct { WithdrawingMin = 150m };
     Assert.AreEqual(150m, saving.WithdrawingMin.Value);
 }
Exemplo n.º 12
0
 public void Get_Set_WithdrawingMax()
 {
     SavingProduct saving = new SavingProduct { WithdrawingMax = 300m };
     Assert.AreEqual(300m, saving.WithdrawingMax.Value);
 }
Exemplo n.º 13
0
 public void Get_Set_Name()
 {
     SavingProduct saving = new SavingProduct { Name = "Saving Product Name" };
     Assert.AreEqual("Saving Product Name", saving.Name);
 }
Exemplo n.º 14
0
 public void Get_Set_InterestRateMin()
 {
     SavingProduct saving = new SavingProduct { InterestRateMin = .15d };
     Assert.AreEqual(.15d, saving.InterestRateMin);
 }
Exemplo n.º 15
0
 public void Get_Set_InterestRateMax()
 {
     SavingProduct saving = new SavingProduct { InterestRateMax = .55d };
     Assert.AreEqual(.55d, saving.InterestRateMax);
 }
Exemplo n.º 16
0
        public void CalculateInterest_OneMonth_Withdraw_FirstDayOfMonth()
        {
            SavingProduct product = new SavingProduct
            {
                Id = 1,
                InterestBase = OSavingInterestBase.Monthly,
                InterestFrequency = OSavingInterestFrequency.EndOfYear,
                CalculAmountBase = OSavingCalculAmountBase.MinimalAmount
            };
            Saving saving = new Saving(ApplicationSettings.GetInstance(""), new User(),
                1000, new DateTime(2009, 01, 01)) { Product = product, InterestRate = 0.1 };

            saving.Withdraw(100, new DateTime(2009, 01, 01), "retrait", new User());

            List<SavingInterestsAccrualEvent> list = new List<SavingInterestsAccrualEvent>();
            list = saving.CalculateInterest(new DateTime(2009, 02, 01), new User { Id = 1 });

            Assert.AreEqual(list.Count, 1);
            Assert.AreEqual(list[0].Amount, 90);
        }
Exemplo n.º 17
0
 public void Get_Set_ClientType()
 {
     SavingProduct saving = new SavingProduct { ClientType = OClientTypes.Person };
     Assert.AreEqual(OClientTypes.Person, saving.ClientType);
 }
Exemplo n.º 18
0
 public void Get_Set_InterestBase()
 {
     SavingProduct product = new SavingProduct { InterestBase = OSavingInterestBase.Monthly };
     Assert.AreEqual(OSavingInterestBase.Monthly, product.InterestBase);
 }