public void TrackEnteredEvent_TrackEnteredAirspaceMoreThan5SecondsAgo_IsNotBeingRenderedAnymore()
        {
            //Track in airspace
            List <string> data = new List <string>
            {
                "ABC123;30000;30000;3000;20181224200050123"
            };

            //Create new event
            RawTransponderDataEventArgs newEvent = new RawTransponderDataEventArgs(data);

            //Give new event to transponderReceiver
            transponderReceiver.ReceiverOnTransponderDataReady(new object(), newEvent);

            //Sleep for More than 5 seconds
            Thread.Sleep(5200);

            //Reset consoleOutput, so calls to print done during the first 5 seconds won't count.
            fakeConsoleOutput.ClearReceivedCalls();

            //Wait for some time, to see if any events are rendered
            Thread.Sleep(5200);

            //Console did not receive anything
            fakeConsoleOutput.DidNotReceiveWithAnyArgs().Print("Any string");
        }
示例#2
0
        public void TrackEnteredEvent_TrackEnteredAirspaceMoreThan5SecondsAgo_IsNotBeingRenderedAnymore()
        {
            ATM.HandleNewTrackData(trackData1);

            //Sleep for More than 5 seconds
            Thread.Sleep(5200);

            //Reset consoleOutput, so calls to print done during the first 5 seconds won't count.
            fakeConsoleOutput.ClearReceivedCalls();

            //Wait for some time, to see if any events are rendered
            Thread.Sleep(5200);

            //Console did not receive anything
            fakeConsoleOutput.DidNotReceiveWithAnyArgs().Print("Any string");
        }
示例#3
0
        public void RenderEvents_OneEventInList_PrintCalledOnce()
        {
            //Test is done with seperation events, since the _isRaised-attribute of
            //TrackEnteredEvent and TrackLeftEvent goes false after a set amount of time, introducing possible errors
            List <TrackData> tracks = new List <TrackData>();

            tracks.Add(td1);
            tracks.Add(td2);
            SeperationEvent se1 = new SeperationEvent(timeStamp, tracks, false, fakeConsoleOutput, fakeFileOutput);

            uut.events.Add(se1);

            string expectedString = se1.FormatData();

            //Console output did not receive anything before rendering
            fakeConsoleOutput.DidNotReceiveWithAnyArgs().Print("Any string");

            uut.RenderEvents();

            //Check that Print was called only once
            fakeConsoleOutput.ReceivedWithAnyArgs().Print("Any string");
        }