Esempio n. 1
0
        public void SelectAll()
        {
            List <ISavingsContract> listSaving = _savingManager.SelectAll();

            Assert.AreEqual(listSaving.Count, 2);

            Assert.AreEqual(listSaving[0].Id, 1);
            Assert.AreEqual(listSaving[0].Code, "S/BC/2007/SAVIN-1/ELFA-6");
            Assert.AreEqual(listSaving[0].Status, OSavingsStatus.Active);
            Assert.AreEqual(listSaving[0].CreationDate, new DateTime(2007, 01, 01));
            Assert.AreEqual(listSaving[0].InterestRate, 0.25);
            Assert.AreEqual(listSaving[0].Product.Id, 1);
            Assert.AreEqual(listSaving[0].Product.Name, "SavingProduct1");
            Assert.AreEqual(listSaving[0].GetBalance(), 100);
            Assert.AreEqual(((SavingBookContract)listSaving[0]).FlatWithdrawFees, 3);
            Assert.AreEqual(((SavingBookContract)listSaving[0]).RateWithdrawFees.HasValue, false);
            Assert.AreEqual(((SavingBookContract)listSaving[0]).FlatTransferFees, 3);
            Assert.AreEqual(((SavingBookContract)listSaving[0]).RateTransferFees.HasValue, false);

            Assert.AreEqual(listSaving[1].Id, 2);
            Assert.AreEqual(listSaving[1].Code, "S/BC/2008/SAVIN-1/ELFA-7");
            Assert.AreEqual(listSaving[1].Status, OSavingsStatus.Closed);
            Assert.AreEqual(listSaving[1].CreationDate, new DateTime(2008, 01, 02));
            Assert.AreEqual(listSaving[1].ClosedDate, new DateTime(2008, 10, 01));
            Assert.AreEqual(listSaving[1].InterestRate, 0.30);
            Assert.AreEqual(listSaving[1].Product.Id, 1);
            Assert.AreEqual(listSaving[1].Product.Name, "SavingProduct1");
            Assert.AreEqual(listSaving[1].GetBalance(), 0);
            Assert.AreEqual(((SavingBookContract)listSaving[1]).FlatWithdrawFees, 3);
            Assert.AreEqual(((SavingBookContract)listSaving[1]).RateWithdrawFees.HasValue, false);
            Assert.AreEqual(((SavingBookContract)listSaving[1]).FlatTransferFees, 3);
            Assert.AreEqual(((SavingBookContract)listSaving[1]).RateTransferFees.HasValue, false);
        }