예제 #1
0
 public void Update_ValidTrackIsStored_UpdateIsCalled()
 {
     _track1.Tag = "AAA111";
     _uut.Add(_track1);
     _uut.Update(_track1);
     _track1.Received().Update(_track1);
 }
예제 #2
0
        public void Update(Tos obj)
        {
            var recievedTracks = obj.RecievedTracks;

            foreach (var track in recievedTracks)
            {
                if (_airSpace.IsInValidAirSpace(track))
                {
                    if (_trackStorage.Contains(track))
                    {
                        _trackStorage.Update(track);
                    }
                    else
                    {
                        _trackStorage.Add(track);
                    }
                }
                else if (_trackStorage.Contains(track) && !_airSpace.IsInValidAirSpace(track))
                {
                    _trackStorage.Remove(track);
                }
            }

            _collisonDetector.CheckForCollision(_trackStorage.GetAllTracks());
            _render.PrintTrackData(_trackStorage.GetAllTracks());
        }