public void TestBankAddGetUpdateDelete()
        {
            //Add-Get-Тест
            decimal? ammount = 2000;
            DateTime date = DateTime.Now;

            Bank expectedBank = new Bank();
            expectedBank.Ammount = ammount;
            expectedBank.Date = date;

            AccessToBank bank = new AccessToBank();
            bank.AddElement(expectedBank);
            var actualBank = bank.GetAll().Last();
            Assert.AreEqual(expectedBank, actualBank);

            //Update - Тест
            expectedBank = actualBank;
            expectedBank.Ammount = 3000;
            bank.UpdateElement(expectedBank);
            actualBank = bank.GetElement(expectedBank.CodePayment);
            Assert.AreEqual(expectedBank, actualBank);

            //Delete-Тест
            int expectedCount = bank.GetAll().Count() - 1;
            bank.DeleteElement(actualBank);
            int actualCount = bank.GetAll().Count();
            Assert.AreEqual(expectedCount, actualCount);
        }
Beispiel #2
0
        public void TestBankAddGetUpdateDelete()
        {
            //Add-Get-Тест
            decimal? ammount = 2000;
            DateTime date    = DateTime.Now;

            Bank expectedBank = new Bank();

            expectedBank.Ammount = ammount;
            expectedBank.Date    = date;

            AccessToBank bank = new AccessToBank();

            bank.AddElement(expectedBank);
            var actualBank = bank.GetAll().Last();

            Assert.AreEqual(expectedBank, actualBank);

            //Update - Тест
            expectedBank         = actualBank;
            expectedBank.Ammount = 3000;
            bank.UpdateElement(expectedBank);
            actualBank = bank.GetElement(expectedBank.CodePayment);
            Assert.AreEqual(expectedBank, actualBank);

            //Delete-Тест
            int expectedCount = bank.GetAll().Count() - 1;

            bank.DeleteElement(actualBank);
            int actualCount = bank.GetAll().Count();

            Assert.AreEqual(expectedCount, actualCount);
        }
 public CCashier(ref AccessToBank bank,ref AccessToBasicReis basicReis, ref AccessToReis reis, ref AccessToClients clients, ref AccessToPlanes aircrafts)
 {
     BankEntitie = bank;
     ReisEntitie = reis;
     ClientsEntitie = clients;
     BasicReisEntitie = basicReis;
     PlanesEntitie = aircrafts;
 }
        static void Main(string[] args)
        {
            //Инициализуруем и заполняем необходимые объекты
            AccessToBank Bank = new AccessToBank();
            AccessToBasicReis BasicReis = new AccessToBasicReis();
            AccessToReis Reis = new AccessToReis();
            AccessToClients Clients = new AccessToClients();
            AccessToPlanes Planes = new AccessToPlanes();

            AutoComplete.Complete(ref BasicReis, ref Planes);

            CCashier Cashier = new CCashier(ref Bank, ref BasicReis, ref Reis, ref Clients, ref Planes);

            OutMenu(Reis, Cashier);
        }