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 == "Вернулся"); }
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); }
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); }
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; }
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 == "Вернулся"); }
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); }