예제 #1
0
        public void TestBasicReisAddGetUpdateDelete()
        {
            //Add-Get-Тест
            DateTime  date = DateTime.Now;
            BasicReis expectedBasicReis = new BasicReis();

            expectedBasicReis.Date = date;

            DataAccessBasicReis basicReis = new DataAccessBasicReis();

            basicReis.AddElement(expectedBasicReis);
            var actualBasicReis = basicReis.GetAll().Last();

            Assert.AreEqual(expectedBasicReis, actualBasicReis);

            //Update - Тест
            expectedBasicReis      = actualBasicReis;
            expectedBasicReis.Date = date.AddDays(2);
            basicReis.UpdateElement(expectedBasicReis);
            actualBasicReis = basicReis.GetElement(expectedBasicReis.CodeBasicReis);
            Assert.AreEqual(expectedBasicReis, actualBasicReis);

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

            basicReis.DeleteElement(actualBasicReis);
            int actualCount = basicReis.GetAll().Count();

            Assert.AreEqual(expectedCount, actualCount);
        }
        public void TestBasicReisAddGetUpdateDelete()
        {
            //Add-Get-Тест
            DateTime date = DateTime.Now;
            BasicReis expectedBasicReis = new BasicReis();
            expectedBasicReis.Date = date;

            DataAccessBasicReis basicReis = new DataAccessBasicReis();
            basicReis.AddElement(expectedBasicReis);
            var actualBasicReis = basicReis.GetAll().Last();
            Assert.AreEqual(expectedBasicReis, actualBasicReis);

            //Update - Тест
            expectedBasicReis = actualBasicReis;
            expectedBasicReis.Date = date.AddDays(2);
            basicReis.UpdateElement(expectedBasicReis);
            actualBasicReis = basicReis.GetElement(expectedBasicReis.CodeBasicReis);
            Assert.AreEqual(expectedBasicReis, actualBasicReis);

            //Delete-Тест
            int expectedCount = basicReis.GetAll().Count() - 1;
            basicReis.DeleteElement(actualBasicReis);
            int actualCount = basicReis.GetAll().Count();
            Assert.AreEqual(expectedCount, actualCount);
        }
예제 #3
0
 public CCashier(ref DataAccessBank bank, ref DataAccessBasicReis basicReis, ref DataAccessReis reis, ref DataAccessClients clients, ref DataAccessPlains aircrafts)
 {
     BankEntitie      = bank;
     ReisEntitie      = reis;
     ClientsEntitie   = clients;
     BasicReisEntitie = basicReis;
     PlainsEntitie    = aircrafts;
 }
 public CCashier(ref DataAccessBank bank,ref DataAccessBasicReis basicReis, ref DataAccessReis reis, ref DataAccessClients clients, ref DataAccessPlains aircrafts)
 {
     BankEntitie = bank;
     ReisEntitie = reis;
     ClientsEntitie = clients;
     BasicReisEntitie = basicReis;
     PlainsEntitie = aircrafts;
 }
        public HomeController()
        {
            //Инициализуруем и заполняем необходимые объекты
            DataAccessBank Bank = new DataAccessBank();
            DataAccessBasicReis BasicReis = new DataAccessBasicReis();
            DataAccessReis Reis = new DataAccessReis();
            DataAccessClients Clients = new DataAccessClients();
            DataAccessPlains Plains = new DataAccessPlains();

            Cashier = new CCashier(ref Bank, ref BasicReis, ref Reis, ref Clients, ref Plains);
        }
        public HomeController()
        {
            //Инициализуруем и заполняем необходимые объекты
            DataAccessBank      Bank      = new DataAccessBank();
            DataAccessBasicReis BasicReis = new DataAccessBasicReis();
            DataAccessReis      Reis      = new DataAccessReis();
            DataAccessClients   Clients   = new DataAccessClients();
            DataAccessPlains    Plains    = new DataAccessPlains();

            Cashier = new CCashier(ref Bank, ref BasicReis, ref Reis, ref Clients, ref Plains);
        }
        static void Main(string[] args)
        {
            //Инициализуруем и заполняем необходимые объекты
            DataAccessBank Bank = new DataAccessBank();
            DataAccessBasicReis BasicReis = new DataAccessBasicReis();
            DataAccessReis Reis = new DataAccessReis();
            DataAccessClients Clients = new DataAccessClients();
            DataAccessPlains Plains = new DataAccessPlains();

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

            OutMenu(Reis, Cashier);
        }