예제 #1
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());
        }
예제 #2
0
 public void Add_ValidTrackTwice_OnlyAddOnce()
 {
     _track1.Tag = "AAA111";
     _uut.Add(_track1);
     _uut.Add(_track1);
     Assert.That(_uut.GetAllTracks().Count, Is.EqualTo(1));
 }