Ejemplo n.º 1
0
        public void GetTrackingsInAirspace_WhenCalled_ReturnsTrackingsInsideAirspaceOnly(int x, int y, int z, int expectedResult)
        {
            var trackings = new HashSet <ITrack>
            {
                CreateTrack(x, y, z)
            };

            var trackingsInAirspace = _airspaceService.GetTrackingsInAirspace(trackings, _airspace);

            Assert.That(trackingsInAirspace.Count, Is.EqualTo(expectedResult));
        }
        private void TransponderReceiver_DataReady(object sender, RawTransponderDataEventArgs e)
        {
            //All to do with tracking and updates
            HashSet <ITrack> newTrackings = _trackingService.CreateTrackings(e.TransponderData);

            HashSet <ITrack> filteredTrackings = _airspaceService.GetTrackingsInAirspace(newTrackings, _airspace);

            _trackings = _trackingService.UpdateTrackings(filteredTrackings, _trackings);

            OnTrackingsChanged();

            //All to do with separations
            HashSet <ISeparationEvent> allSeparationEvents = _separationService.GetAllSeparationEvents(_trackings);

            HashSet <ISeparationEvent> newSeparationEvents =
                _separationService.GetNewSeparationEvents(allSeparationEvents, _separationEvents);

            _separationService.LogSeparationEvents(newSeparationEvents);

            _separationEvents = _separationService.UpdateSeparationEvents(allSeparationEvents, _separationEvents);

            OnSeparationEventChanged();
        }