public void TrackEnteredRender_isCalled_consoleOutputReceivesCorrectString()
        {
            string expectedString = "Track entered airspace - Occurencetime: 235928121999 Involved track: ABC123";

            uut_tee.Render();

            fakeConsoleOutput.Received().Print(Arg.Is <string>(str => str.Contains(expectedString)));
        }
        public void ATMclass_TrackData_AddTrackToCurrentTracks()
        {
            TrackData trackData3 = new TrackData("DEF456", 10002, 10002, 1002, "201811071339000", 0, 0, fakeConsoleOutput);
            atmClass.HandleNewTrackData(trackData3);

            string expectedString =
                $"{trackData3._Tag} - ( {trackData3._CurrentXcord}, {trackData3._CurrentYcord}, {trackData3._CurrentZcord}) - Speed: {trackData3._CurrentHorzVel} m/s - Course: {trackData3._CurrentCourse} degrees";

            fakeConsoleOutput.Received().Print(Arg.Is<string>(expectedString));
        }
Пример #3
0
        public void ATMclass_TrackData_AddNewTrack()
        {
            //Opretter et track som er inden for vores Airspace
            TrackData trackData =
                new TrackData("DEF456", 10002, 10002, 1002, "201811071339000", 0, 0, fakeConsoleOutput);

            atmClass.HandleNewTrackData(trackData);

            string expectedString =
                $"{trackData.Tag} - ( {trackData.CurrentXcord}, {trackData.CurrentYcord}, {trackData.CurrentZcord}) - Speed: {trackData.CurrentHorzVel} m/s - Course: {trackData.CurrentCourse} degrees";

            //Sleep for a bit to make sure that the render function has been called
            Thread.Sleep(200);

            fakeConsoleOutput.Received().Print(Arg.Is <string>(expectedString));
        }
Пример #4
0
        public void RenderEvents_SeperationEventInList_CorrectStringPrinted()
        {
            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();

            //Console output received the expected string
            fakeConsoleOutput.Received().Print(Arg.Is <string>(str => str.Contains(expectedString)));
        }
Пример #5
0
        public void Renderer_renderTrackData_OutputReceivesCorrectString()
        {
            trackData1.render();
            string Tag = trackData1._Tag;
            double x = trackData1._CurrentXcord;
            double y = trackData1._CurrentYcord;
            double z = trackData1._CurrentZcord;
            double horzVel = trackData1._CurrentHorzVel;
            double course = trackData1._CurrentCourse;

            fakeConsoleOutput.Received(Arg.Any<String>().Contains(Tag + " - " + "(" + x + "," + y + "," + z + ")" + " - " + "Speed: " + horzVel + "m/s - Course: " + course + " degrees."));
        }
        public void TrackEnteredEvent_NewTrackInAirspaceAdded_RendererPrintsExpectedString()
        {
            string expectedString = "Track entered airspace - Occurencetime: 20181224200050123 Involved track: ABC123";

            //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 a bit, to make sure that new event has been rendered
            Thread.Sleep(200);

            fakeConsoleOutput.Received().Print(Arg.Is <string>(expectedString));
        }
Пример #7
0
        public void TrackData_Render_RendererReceivedCorrectString()
        {
            string Tag     = uut.Tag;
            double x       = uut.CurrentXcord;
            double y       = uut.CurrentYcord;
            double z       = uut.CurrentZcord;
            double horzVel = uut.CurrentHorzVel;
            double course  = uut.CurrentCourse;

            string expectedString = $"{Tag} - ( {x}, {y}, {z}) - Speed: {horzVel} m/s - Course: {course} degrees";

            uut.Render();

            fakeConsoleOutput.Received().Print(Arg.Is <string>(str => str.Contains(expectedString)));
        }
Пример #8
0
        public void TrackEnteredEvent_NewTrackInAirspaceAdded_RendererPrintsExpectedString()
        {
            string expectedString = "Track entered airspace - Occurencetime: 20181224200050123 Involved track: ABC123";

            ATM.HandleNewTrackData(trackData1);

            //Sleep for a bit, to make sure that new event has been rendered
            Thread.Sleep(200);

            fakeConsoleOutput.Received().Print(Arg.Is <string>(expectedString));
        }