Esempio n. 1
0
        public void OuterTransferTest()
        {
            //Arrange
            CKIR  KIR   = new CKIR();
            CBank bank1 = new CBank(KIR);
            CBank bank2 = new CBank(KIR);

            KIR.AddBank(bank1);
            KIR.AddBank(bank2);

            bank1.AddCustomer("Ivan", "Pavlov", 1);
            bank1.StoreAccount(1, 1);

            bank2.AddCustomer("Rafal", "Swierczewsky", 2);
            bank2.StoreAccount(2, 2);

            bank1.PayIn(bank1.GetAccount(1), 600m);
            bank1.Transfer(bank1.GetAccount(1), bank2.GetAccount(2), 500m);
            bank1.Send();
            KIR.Send();

            //Assert
            Assert.AreEqual(bank2.GetAccount(2).GetSaldo(), 500m);
            Assert.AreEqual(bank1.GetAccount(1).GetSaldo(), 100m);
        }
Esempio n. 2
0
        public void KIRAddBankTest()
        {
            //Arrange
            CKIR  KIR   = new CKIR();
            CBank bank1 = new CBank(KIR);
            CBank bank2 = new CBank(KIR);

            KIR.AddBank(bank1);
            KIR.AddBank(bank2);

            //Assert
            Assert.IsTrue(KIR.IsBankExist(bank1));
            Assert.IsTrue(KIR.IsBankExist(bank2));
        }
Esempio n. 3
0
        public void DI_KIRAddBankTest()
        {
            //Arrange
            CKIR KIR = new CKIR();

            var kernel = new StandardKernel();

            kernel.Load(Assembly.GetExecutingAssembly());

            var bank1 = kernel.Get <IBank>();
            var bank2 = kernel.Get <IBank>();


            KIR.AddBank(bank1);
            KIR.AddBank(bank2);

            //Assert
            Assert.IsTrue(KIR.IsBankExist(bank1));
            Assert.IsTrue(KIR.IsBankExist(bank2));
            Assert.IsTrue(bank1.GetType() == typeof(CBank));
        }