Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ITransponderReceiver receiver = TransponderReceiverFactory.CreateTransponderDataReceiver();

            Decoder       d1  = new Decoder(receiver);
            AMSController ams = new AMSController(d1, new Airspace(

                                                      South: 10000,
                                                      West: 10000,
                                                      North: 90000,
                                                      East: 90000,
                                                      LowerAltitude: 500,
                                                      UpperAltitude: 20000
                                                      ));

            CollisionAvoidanceSystem cas = new CollisionAvoidanceSystem(ams, 20000, 10000);
            Logger fl     = new Logger(cas);
            Output output = new Output();

            ConsoleOutput c = new ConsoleOutput(ams, cas, output);

            while (true)
            {
                Thread.Sleep(1000);
            }
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            _fakeTransponderReceiver = Substitute.For <ITransponderReceiver>();
            _fakeOutput      = Substitute.For <IOutput>();
            _fakeIFileLogger = Substitute.For <IFileLogger>();

            _realAirspace = new Airspace(10000, 10000, 90000, 90000, 500, 20000)
            {
                South         = 10000,
                West          = 10000,
                North         = 90000,
                East          = 90000,
                LowerAltitude = 500,
                UpperAltitude = 20000
            };

            _realDecoder         = new Decoder(_fakeTransponderReceiver);
            _realAmsController   = new AMSController(_realDecoder, _realAirspace);
            _realAvoidanceSystem = new CollisionAvoidanceSystem(_realAmsController, 5000, 300);

            _realLogger        = new Logger(_realAvoidanceSystem);
            _realConsoleOutput = new ConsoleOutput(_realAmsController, _realAvoidanceSystem, _fakeOutput);

            _realAvoidanceSystem.SeparationEvent += (o, args) => { ++_nSeperationEvent; };
        }
Ejemplo n.º 3
0
        public void SetUp()
        {
            transponder = Substitute.For <ITransponderReceiver>();

            airspace      = new Airspace(10000, 10000, 90000, 90000, 500, 20000);
            decoder       = new Decoder(transponder);
            amsController = new AMSController(decoder, airspace);

            amsController.FilteredAircraftsEvent    += (o, args) => { ++_nFilteredAircraftEvent; };
            amsController.TrackEnteredAirspaceEvent += (o, args) => { ++_nTrackEnteredAirspaceEvent; };
            amsController.TrackLeftAirspaceEvent    += (o, args) => { ++_nTrackLeftAirspaceEvent; };
            decoder.DataDecodedEvent += (o, args) => { ++_nDataDecodedEvent; };
        }
Ejemplo n.º 4
0
        public void Setup()
        {
            _fakeTransponderReceiver = Substitute.For <ITransponderReceiver>();
            _fakeOutput     = Substitute.For <IOutput>();
            _fakeFileLogger = Substitute.For <IFileLogger>();
            _fakeLogger     = Substitute.For <ILogger>();

            _realAirspace = new Airspace(10000, 10000, 90000, 90000, 500, 20000);

            _realAirspace = new Airspace(10000, 10000, 90000, 90000, 500, 20000);
            _realDecoder  = new Decoder(_fakeTransponderReceiver);

            // UNDER TEST
            _realAmsController   = new AMSController(_realDecoder, _realAirspace);
            _realAvoidanceSystem = new CollisionAvoidanceSystem(_realAmsController, 5000, 300);
            //Tests will not work, if ConsoleOutput is not present.
            _realConsoleOutput = new ConsoleOutput(_realAmsController, _realAvoidanceSystem, _fakeOutput);

            _realAvoidanceSystem.SeparationEvent += (o, args) => { ++_nSeparationEvents; };
        }
Ejemplo n.º 5
0
        public void Setup()
        {
            _fakeDecoder  = Substitute.For <IDecoder>();
            _fakeAirspace = Substitute.For <IAirspace>();

            _testAirspace = new Airspace(10000, 10000, 90000, 90000, 500, 20000)
            {
                South         = 10000,
                West          = 10000,
                North         = 90000,
                East          = 90000,
                LowerAltitude = 500,
                UpperAltitude = 20000
            };

            _uut = new AMSController(_fakeDecoder, _fakeAirspace);

            _uut.FilteredAircraftsEvent    += (o, args) => { ++_nFilteredAircraftEvent; };
            _uut.TrackEnteredAirspaceEvent += (o, args) => { ++_nTrackEnteredAirspaceEvent; };
            _uut.TrackLeftAirspaceEvent    += (o, args) => { ++_nTrackLeftAirspaceEvent; };
        }