Exemplo n.º 1
0
        public void CheckEventsDbTest()
        {
            PrepareTestEvent();
            var TestListEvents = new List <object[]>();

            TestListEvents = PrepareTestListEvents(1);
            MsDb msDb = new MsDb("name=StaffContextTests");

            msDb.CheckEventsDb(TestListEvents);

            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");
            String        EventName     = msDbRequester.getEventNameByPupilIdOld(5000);

            Assert.IsTrue(EventName == "Первый проход");

            TestListEvents = PrepareTestListEvents(2);
            msDb.CheckEventsDb(TestListEvents);
            EventName = msDbRequester.getEventNameByPupilIdOld(5000);
            Assert.IsTrue(EventName == "Первый проход");

            TestListEvents = PrepareTestListEvents(3);
            msDb.CheckEventsDb(TestListEvents);
            EventName = msDbRequester.getEventNameByPupilIdOld(5000);
            Assert.IsTrue(EventName == "Вышел");

            TestListEvents = PrepareTestListEvents();
            msDb.CheckEventsDb(TestListEvents);
            EventName = msDbRequester.getEventNameByPupilIdOld(5000);
            Assert.IsTrue(EventName == "Вернулся");
        }
Exemplo n.º 2
0
        public void IsOutPutEventNameTest()
        {
            MsDb    msDb = new MsDb("name=StaffContextTests");
            Boolean res  = msDb.IsOutPutEventName("Вышел");

            Assert.IsTrue(res);
            res = msDb.IsOutPutEventName("Прогул");
            Assert.IsTrue(res);
            res = msDb.IsOutPutEventName("ПРОСТО СТРОКА");
            Assert.IsFalse(res);
        }
Exemplo n.º 3
0
        public void IsOutputPassTest()
        {
            MsDb    msDb = new MsDb("name=StaffContextTests");
            Boolean pass = msDb.IsOutputPass(8564);

            Assert.IsTrue(pass);
            pass = msDb.IsOutputPass(9369);
            Assert.IsTrue(pass);
            pass = msDb.IsOutputPass(8677);
            Assert.IsFalse(pass);
        }
Exemplo n.º 4
0
        public void IsInputEventNameTest()
        {
            MsDb    msDb = new MsDb("name=StaffContextTests");
            Boolean res  = msDb.IsInputEventName("Первый проход");

            Assert.IsTrue(res);
            res = msDb.IsInputEventName("Вернулся");
            Assert.IsTrue(res);
            res = msDb.IsInputEventName("Опоздал");
            Assert.IsTrue(res);
            res = msDb.IsInputEventName("ПРОСТО СТРОКА");
            Assert.IsFalse(res);
        }
 public EljurBaseClass(Message Message, Config Config, MsDb MsDb, Firebird Firebird,
                       TimeChecker TimeChecker, EljurApiSender EljurApiSender, MsDbCatcherFirstPass MsDbCatcherFirstPass, MsDbCatcherLastPass MsDbCatcherLastPass,
                       MsDbSetter MsDbSetter)
 {
     this.message              = Message;
     this.config               = Config;
     this.msDb                 = new MsDb("name=StaffContext", config.ConfigsTreeIdResourceOutput1, config.ConfigsTreeIdResourceOutput2, config.ConfigsTreeIdResourceInput1, config.ConfigsTreeIdResourceInput2);
     this.firebird             = Firebird;
     this.timeChecker          = new TimeChecker(config.timeFromDel, config.timeToDel);
     this.eljurApiSender       = EljurApiSender;
     this.msDbCatcherFirstPass = MsDbCatcherFirstPass;
     this.msDbCatcherLastPass  = MsDbCatcherLastPass;
     this.msDbSetter           = MsDbSetter;
 }
Exemplo n.º 6
0
        public void RegisterInputEventTest()
        {
            PrepareTestEvent();
            var TestListEvents = new List <object[]>();

            TestListEvents = PrepareTestListEvents(1);
            MsDb          msDb          = new MsDb("name=StaffContextTests");
            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");
            var           curEvent      = msDbRequester.getEventdByPupilIdOld(5000);

            msDb.RegisterInputEvent(curEvent, TestListEvents.First(), 5000);
            String EventName = msDbRequester.getEventNameByPupilIdOld(5000);

            Assert.IsTrue(EventName == "Вернулся");
        }
Exemplo n.º 7
0
        public void AddNewEventTest()
        {
            PrepareTestEvent();
            MsDbSetter msDbSetter = new MsDbSetter("name=StaffContextTests");

            msDbSetter.SetDelAllEventsForTesting();
            var TestListEvents = new List <object[]>();

            TestListEvents = PrepareTestListEvents(1);
            MsDb          msDb          = new MsDb("name=StaffContextTests");
            MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests");

            msDb.AddNewEvent(TestListEvents.First(), 5000);
            String EventName = msDbRequester.getEventNameByPupilIdOld(5000);

            Assert.IsTrue(EventName == "Первый проход");

            msDbSetter.SetDelAllEventsForTesting();
            TestListEvents = PrepareTestListEvents(3);
            msDb.AddNewEvent(TestListEvents.First(), 5000);
            EventName = msDbRequester.getEventNameByPupilIdOld(5000);
            TestContext.WriteLine(EventName);
            Assert.IsTrue(EventName == null);
        }