public void CheckTimeTest()
        {
            TimeSpan    now                  = DateTime.Now.TimeOfDay;
            TimeSpan    nowPlusMinute        = now.Add(new TimeSpan(0, 1, 0));
            TimeSpan    nowMinusMinute       = now.Add(new TimeSpan(0, -1, 0));
            TimeChecker timeCheckerWithParam = new TimeChecker(nowMinusMinute, nowPlusMinute);

            timeCheckerWithParam.CheckTime(new Action(delegate {
                MsDbCleaner msDbCleaner = new MsDbCleaner("name=StaffContextTests");
                MsDbUpdater msDbUpdater = new MsDbUpdater("name=StaffContextTests");
                msDbCleaner.clearAllTablesBesidesPupils();

                var AllStaff   = new List <object[]>();
                AllStaff       = getStaffListTest();
                var AllClasses = getClassesListTest();
                msDbUpdater.UpdateMsDb(AllStaff, AllClasses);
            }));

            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");
            String        FullFIO1      = msDbRequester.getFullFIOByPupilIdOld(5000);
            String        FullFIO2      = msDbRequester.getFullFIOByPupilIdOld(5001);
            String        FullFIO3      = msDbRequester.getFullFIOByPupilIdOld(5002);

            Assert.IsTrue(FullFIO1 == "Обновляев Обновляй Обновляевич");
            Assert.IsTrue(FullFIO2 == "Петров Петр Петрович");
            Assert.IsTrue(FullFIO3 == "Сидоров Сидор Сидорович");
        }
        public void MainUpdateStaffTest()
        {
            MainStaffUpdater mainStaffUpdater = new MainStaffUpdater("name=StaffContextTests");
            var AllStaff = getStaffListTest();

            mainStaffUpdater.MainUpdateStaff(AllStaff);

            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");
            String        FullFIO1      = msDbRequester.getFullFIOByPupilIdOld(5000);
            String        FullFIO2      = msDbRequester.getFullFIOByPupilIdOld(5001);
            String        FullFIO3      = msDbRequester.getFullFIOByPupilIdOld(5002);

            Assert.IsTrue(FullFIO1 == "Иванов Иван Иванович");
            Assert.IsTrue(FullFIO2 == "Петров Петр Петрович");
            Assert.IsTrue(FullFIO3 == "Сидоров Сидор Сидорович");
        }
        public void FillOnlyPupilsTest()
        {
            PrepareTest();
            MsDbFiller msDbFiller = new MsDbFiller("name=StaffContextTests");
            var        AllStaff   = getStaffListTest();

            msDbFiller.FillOnlyPupils(AllStaff);
            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");
            String        FullFIO1      = msDbRequester.getFullFIOByPupilIdOld(5000);
            String        FullFIO2      = msDbRequester.getFullFIOByPupilIdOld(5001);
            String        FullFIO3      = msDbRequester.getFullFIOByPupilIdOld(5002);

            Assert.IsTrue(FullFIO1 == "Иванов Иван Иванович");
            Assert.IsTrue(FullFIO2 == "Петров Петр Петрович");
            Assert.IsTrue(FullFIO3 == "Сидоров Сидор Сидорович");
        }
        public void UpdateStaffTest()
        {
            PrepareTest();
            MsDbStaffUpdater msDbStaffUpdater = new MsDbStaffUpdater("name=StaffContextTests");
            var AllStaff = getStaffListTestUpdated();

            msDbStaffUpdater.UpdateStaff(AllStaff);
            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");
            String        FullFIO1      = msDbRequester.getFullFIOByPupilIdOld(5000);
            String        FullFIO2      = msDbRequester.getFullFIOByPupilIdOld(5001);
            String        FullFIO3      = msDbRequester.getFullFIOByPupilIdOld(5002);

            Assert.IsTrue(FullFIO1 == "Иванова Ивана Ивановна");
            Assert.IsTrue(FullFIO2 == "Петрова Петра Петровна");
            Assert.IsTrue(FullFIO3 == "Сидорова Сидора Сидоровна");
        }
Esempio n. 5
0
        public void getFullFIOByPupilIdOldTest()
        {
            PrepareTestPupil();
            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");
            String        FullFIO       = msDbRequester.getFullFIOByPupilIdOld(5005);

            TestContext.WriteLine(FullFIO);
            Assert.IsTrue(FullFIO == "Тестов Тест Тестович");
        }
Esempio n. 6
0
        public void UpdateStaffDbTest()
        {
            MsDbUpdater msDbUpdater = new MsDbUpdater("name=StaffContextTests");
            var         AllStaff    = getStaffListTest();

            msDbUpdater.UpdateStaffDb(AllStaff);

            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");
            String        FullFIO1      = msDbRequester.getFullFIOByPupilIdOld(5000);
            String        FullFIO2      = msDbRequester.getFullFIOByPupilIdOld(5001);
            String        FullFIO3      = msDbRequester.getFullFIOByPupilIdOld(5002);

            Assert.IsTrue(FullFIO1 == "Иванов Иван Иванович");
            Assert.IsTrue(FullFIO2 == "Петров Петр Петрович");
            Assert.IsTrue(FullFIO3 == "Сидоров Сидор Сидорович");
            EmptyChecker emptyChecker = new EmptyChecker("StaffContextTests");

            Assert.IsTrue(false == emptyChecker.IsTableEmpty("Schedules"));
        }
        public void AddNewPupilTest()
        {
            NewStaffAdder newStaffAdder = new NewStaffAdder("name=StaffContextTests");
            var           AllStaff      = getStaffListTest();

            newStaffAdder.AddNewPupil(AllStaff);
            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");
            String        FullFIO       = msDbRequester.getFullFIOByPupilIdOld(5004);

            Assert.IsTrue(FullFIO == "Новиков Новый Новович");
        }