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); }
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)); }
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)); }