Beispiel #1
0
        public void DeleateInterCityTest1()
        {
            DeleateIntercityCall deleateEvent = new DeleateIntercityCall();
            GetIntercityCalls    allCalls     = new GetIntercityCalls();
            DateTime             date         = DateTime.Today;

            var  calls    = allCalls.Get(connection);
            int  ID       = 0;
            bool passFlag = false;

            foreach (IntercityCallModel call in calls)
            {
                if (call.Surname.Equals("TestSur99") && calls.Count == 100)
                {
                    ID       = call.ID;
                    passFlag = true;
                }
            }


            IntercityCallModel model = new IntercityCallModel(ID);

            deleateEvent.Deleate(model, connection);

            allCalls = new GetIntercityCalls();
            calls    = allCalls.Get(connection);

            foreach (IntercityCallModel call in calls)
            {
                if (call.Surname.Equals("TestSur99") && calls.Count != 99)
                {
                    passFlag = false;
                }
            }

            if (passFlag)
            {
                Assert.Pass("Элемент отсутсвует в БД");
            }

            else
            {
                Assert.Fail("Ошибка удаления");
            }
        }
Beispiel #2
0
 public Selection()
 {
     addRequest     = new AddIntercityCall();
     deleateRequest = new DeleateIntercityCall();
     getRequest     = new GetIntercityCalls();
 }