public void CheckCollision_CollidingStringsFromMainReciver_AlarmCalled()
        {
            List <ITrack> list     = new List <ITrack>();
            string        _flight1 = "TRK042;13000;13000;13000;20180403100622937";
            string        _flight2 = "TTG065;13001;13001;13001;20180403100622937";

            _mainreciever.MyReceiver_TransponderDataReady(this, new RawTransponderDataEventArgs(new List <string> {
                _flight1
            }));
            _mainreciever.MyReceiver_TransponderDataReady(this, new RawTransponderDataEventArgs(new List <string> {
                _flight2
            }));
            ITrack track1 = _parseTracks.CreateFlight(_flight1);
            ITrack track2 = _parseTracks.CreateFlight(_flight2);

            list.Add(track1);
            list.Add(track2);

            _collision.TrackComparison(list);
            _alarm.Received().Write(list);
        }
Esempio n. 2
0
        public void CheckCollision_CompareTracks_DetectCollision(int xcoord1, int xcoord2, int verticaldistance1, int verticaldistance2, int count)
        {
            ITrack track1 = new Track();

            track1.XCoordinate = xcoord1;
            track1.YCoordinate = 60000;
            track1.Altitude    = verticaldistance1;

            ITrack track2 = new Track();

            track2.XCoordinate = xcoord2;
            track2.YCoordinate = 60000;
            track2.Altitude    = verticaldistance2;

            List <ITrack> listOfTracks = new List <ITrack>();

            listOfTracks.Add(track1);
            listOfTracks.Add(track2);

            uut.TrackComparison(listOfTracks);
            Assert.That(uut.ConflictingFlights.Count, Is.EqualTo(count));
        }