public void SendNotifyFirstPassTest() { PrepareTestPupil(); PrepareTestEvent(); PrepareTestSchedule(); var TestObject1 = PrepareTestObject5MinPast(); var TestObject2 = PrepareTestObject5MinFuture(); MsDbRequester msDbRequester = new MsDbRequester("name=StaffContextTests"); MsDbSetter msDbSetter = new MsDbSetter("name=StaffContextTests"); EljurApiSender EljurApiSender = new EljurApiSender("name=StaffContextTests"); var result = EljurApiSender.SendNotifyFirstPass(TestObject1); Assert.IsTrue(result); String EventName = msDbRequester.getEventNameByPupilIdOld(5000); Assert.IsTrue(EventName == "Первый проход"); result = EljurApiSender.SendNotifyFirstPass(TestObject2); Assert.IsTrue(result); EventName = msDbRequester.getEventNameByPupilIdOld(5000); msDbSetter.SetDelAllEventsForTesting(); Assert.IsTrue(EventName == "Опоздал"); }
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 SendNotifyLastPassTest() { PrepareTestPupil(); PrepareTestEvent(); var TestObject1 = PrepareTestObject16MinPast(); var TestObject2 = PrepareTestObject5MinPast(); EljurApiSender EljurApiSender = new EljurApiSender("name=StaffContextTests"); var result = EljurApiSender.SendNotifyLastPass(TestObject1); Assert.IsTrue(result); result = EljurApiSender.SendNotifyLastPass(TestObject2); Assert.IsFalse(result); PrepareChangedTestPupil(); result = EljurApiSender.SendNotifyLastPass(TestObject1); //Assert.IsFalse(result); //In this case need always return true!!! Assert.IsTrue(result); }