Beispiel #1
0
        private void CreateTrack(object sender, RawTransponderDataEventArgs rawTransponderDataEventArgs)
        {
            TrackList.Clear();
            //Traverse all elements
            foreach (var data in rawTransponderDataEventArgs.TransponderData)
            {
                // Distribute data to relevant classes

                _flightHandler.Extract(_parser.Parse(data));

                // If inside the monitored area
                if (_monitoredArea.InsideMonitoredArea(_flightHandler.Position))
                {
                    // Format and return the date
                    _formatter.Unformatted = _flightHandler.RawTimestamp;
                    _formatter.FormatTimestamp();

                    Position pos = new Position(_flightHandler.Position.XCoor, _flightHandler.Position.YCoor,
                                                _flightHandler.Position.Altitude);

                    TrackList.Add(new TrackObject(_flightHandler.Tag, pos,
                                                  _formatter.InPretty, _formatter.InDateTime));
                }
            }

            if (TrackList.Count != 0)
            {
                OnTrackListReady(new TrackListUpdatedArgs(TrackList));
            }
        }
Beispiel #2
0
        public void FlightTrackingValidation_XCoordinateInsideUpperMonitor_ReturnsTrue()
        {
            _position.XCoor.Returns(90000);
            _position.YCoor.Returns(50000);
            _position.Altitude.Returns(5000);

            Assert.That(_uut.InsideMonitoredArea(_position), Is.EqualTo(true));
        }
Beispiel #3
0
        public void TrackObjectifier_FormatterFormateTimestamp_ReceivedCall()
        {
            _monitoredArea.InsideMonitoredArea(_flightHandler.Position).Returns(true);
            RaiseFakeTransponderEvent();

            _formatter.Received().FormatTimestamp();
        }