Пример #1
0
        public void SeperationEvent_TrackNotInCollissionAnymore_ConsoleIsNotRenderingSeperationEvent()
        {
            string expectedString1 = "Separation event - Occurencetime: 20181224200050123 Involved tracks: ABC123, DEF123";
            string expectedString2 = "Separation event - Occurencetime: 20181224200050123 Involved tracks: DEF123, ABC123";

            //Add tracks, so that seperation Event occurs
            ATM.HandleNewTrackData(trackData1);
            ATM.HandleNewTrackData(trackData2);

            //Change x-coordinate for one track, so that seperation event does not occur anymore
            trackData1.CurrentXcord += 5002;
            ATM.HandleNewTrackData(trackData1);

            //Wait for a little time to make sure that seperation event is cleared from list at next render.
            Thread.Sleep(2200);

            //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 any Prints about seperation event
            fakeConsoleOutput.DidNotReceive().Print(Arg.Is <string>(expectedString2));
            fakeConsoleOutput.DidNotReceive().Print(Arg.Is <string>(expectedString1));
        }
        public void SeperationEvent_TrackNotInCollissionAnymore_ConsoleIsNotRenderingSeperationEvent()
        {
            string expectedString1 = "Separation event - Occurencetime: 20181224200050123 Involved tracks: ABC123, DEF123";
            string expectedString2 = "Separation event - Occurencetime: 20181224200050123 Involved tracks: DEF123, ABC123";

            //Same track not in airspace
            List <string> data1 = new List <string>
            {
                "ABC123;30000;30000;3000;20181224200050123",
                "DEF123;30001;30001;3001;20181224200050123"
            };

            //Create new event
            RawTransponderDataEventArgs newEvent1 = new RawTransponderDataEventArgs(data1);

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

            //Update X-coordinate of one track, so that seperation event conditions are no longer met.
            List <string> data2 = new List <string>
            {
                "ABC123;50000;30000;3000;20181224200050123",
            };

            //Create new event
            RawTransponderDataEventArgs newEvent2 = new RawTransponderDataEventArgs(data2);

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

            //Wait for a little time to make sure that seperation event is cleared from list at next render.
            Thread.Sleep(2200);

            //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 any Prints about seperation event
            fakeConsoleOutput.DidNotReceive().Print(Arg.Is <string>(expectedString2));
            fakeConsoleOutput.DidNotReceive().Print(Arg.Is <string>(expectedString1));
        }