Example #1
0
        public void CheckForEvent_NewPlanesMultiple_CorrectNumberOfEvents()
        {
            EnterPlanes(PlaneList.Take(2), true);
            EnterPlanes(PlaneList.Skip(2).Take(2), true);
            ShowActiveEvents();

            Assert.That(uut.ActiveAtmEvents.Count(), Is.EqualTo(PlaneList.Count));
        }
Example #2
0
        public void CheckForEvent_NewPlanesMultiple_AllTagsAreCorrect()
        {
            EnterPlanes(PlaneList.Take(2), true);
            EnterPlanes(PlaneList.Skip(2).Take(2), true);
            ShowActiveEvents();

            Assert.That(uut.ActiveAtmEvents.Select(p => p.Tags[0]), Is.EquivalentTo(PlaneList.Select(p => p.Tag)));
        }
Example #3
0
        public void CheckForEvent_NewPlanesMultiple_FirstIsRemovedAfterTime()
        {
            var earlyarrivers = 2;

            Console.WriteLine("Correct Timout: {0}", EnterEventHandler.Timeout);

            var allowedDeviatedTime = (int)(EnterEventHandler.Timeout * (1 - Deviation));

            Console.WriteLine("Allowed Timout: {0}", allowedDeviatedTime);

            EnterPlanes(PlaneList.Take(earlyarrivers));

            Thread.Sleep(EnterEventHandler.Timeout / 2);

            EnterPlanes(PlaneList);

            Assert.That(() => uut.ActiveAtmEvents.Count(), Is.EqualTo(PlaneList.Count - earlyarrivers).After(allowedDeviatedTime));
        }
Example #4
0
        public void CheckForEvent_NewPlanesMultiple_AllIsRemovedAfterTime()
        {
            const int earlyarrivers = 2;

            Console.WriteLine("Correct Timout: {0}", EnterEventHandler.Timeout);

            var allowedDeviatedTime = (int)(EnterEventHandler.Timeout * (1 + Deviation));

            Console.WriteLine("Allowed Timout: {0}", allowedDeviatedTime);

            var pollingInterval = EnterEventHandler.Timeout / 100;

            Console.WriteLine("Polling Interval: {0}", pollingInterval);

            EnterPlanes(PlaneList.Take(earlyarrivers));

            Thread.Sleep(EnterEventHandler.Timeout / 2);

            EnterPlanes(PlaneList);

            Assert.That(() => uut.ActiveAtmEvents, Is.Empty.After(allowedDeviatedTime, pollingInterval));
        }