예제 #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);
        }