public void TestClientsAddGetUpdateDelete()
        {
            //Add-Get-Тест
            bool bookOrBuy = true;
            Clients expectedClients = new Clients();
            expectedClients.BookOrBuy = bookOrBuy;

            AccessToClients basicReis = new AccessToClients();
            basicReis.AddElement(expectedClients);
            var actualClients = basicReis.GetAll().Last();
            Assert.AreEqual(expectedClients, actualClients);

            //Update - Тест
            expectedClients = actualClients;
            expectedClients.BookOrBuy = false;
            basicReis.UpdateElement(expectedClients);
            actualClients = basicReis.GetElement(expectedClients.CodeClient);
            Assert.AreEqual(expectedClients, actualClients);

            //Delete-Тест
            int expectedCount = basicReis.GetAll().Count() - 1;
            basicReis.DeleteElement(actualClients);
            int actualCount = basicReis.GetAll().Count();
            Assert.AreEqual(expectedCount, actualCount);
        }
Esempio n. 2
0
        public void TestClientsAddGetUpdateDelete()
        {
            //Add-Get-Тест
            bool    bookOrBuy       = true;
            Clients expectedClients = new Clients();

            expectedClients.BookOrBuy = bookOrBuy;

            AccessToClients basicReis = new AccessToClients();

            basicReis.AddElement(expectedClients);
            var actualClients = basicReis.GetAll().Last();

            Assert.AreEqual(expectedClients, actualClients);

            //Update - Тест
            expectedClients           = actualClients;
            expectedClients.BookOrBuy = false;
            basicReis.UpdateElement(expectedClients);
            actualClients = basicReis.GetElement(expectedClients.CodeClient);
            Assert.AreEqual(expectedClients, actualClients);

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

            basicReis.DeleteElement(actualClients);
            int actualCount = basicReis.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);
        }