コード例 #1
0
        public void SetUp()
        {
            _transponderReceiver = Substitute.For <ITransponderReceiver>();
            _trackTransmitter    = new TrackTransmitter();
            _dateTimeBuilder     = new DateTimeBuilder();

            _trackObjectifier = new TrackObjectifier(_dateTimeBuilder);

            _trackReciever = new TrackReciever(_transponderReceiver,
                                               _trackObjectifier, _trackTransmitter);
            _output                 = Substitute.For <IOutput>();
            _tracksManager          = Substitute.For <ITracksManager>();
            _airspaceChecker        = Substitute.For <IAirspaceChecker>();
            _uut                    = new TagsManager(_airspaceChecker);
            _courseCalculator       = Substitute.For <ICourseCalculator>();
            _velocityCalculator     = Substitute.For <IVelocityCalculator>();
            _seperationEventChecker = Substitute.For <ISeperationEventChecker>();

            _trackWarehouse = new TrackWarehouse(_uut, _courseCalculator,
                                                 _velocityCalculator, _tracksManager, _seperationEventChecker);
            _atmController = new AtmController(_trackTransmitter, _output, _trackWarehouse);


            _list = new List <string> {
                "ATR423;39045;12932;14000;20151006213456000"
            };

            _trackTransmitter.TrackReady += (o, args) => { _recievedTracks = args.TrackList; };


            // Act
            _transponderReceiver.TransponderDataReady +=
                Raise.EventWith(new RawTransponderDataEventArgs(_list));
        }
コード例 #2
0
        public void Setup()
        {
            //Arrange
            _output = Substitute.For <IOutput>();

            _filePath = @"...\...\...\";
            FileStream   output     = new FileStream(_filePath + "SeperationLogFile.txt", FileMode.Create, FileAccess.Write);
            StreamWriter fileWriter = new StreamWriter(output);

            fileWriter.Write("");
            fileWriter.Close();

            _transponderReceiver = Substitute.For <ITransponderReceiver>();
            _trackTransmitter    = new TrackTransmitter();
            _dateTimeBuilder     = new DateTimeBuilder();

            _trackObjectifier = new TrackObjectifier(_dateTimeBuilder);

            _trackReciever = new TrackReciever(_transponderReceiver,
                                               _trackObjectifier, _trackTransmitter);
            _output                 = Substitute.For <IOutput>();
            _tracksManager          = new TracksManager();
            _courseCalculator       = new CourseCalculator();
            _velocityCalculator     = new VelocityCalculator();
            _seperationEventChecker = new SeperationEventChecker();

            _airspace = new Airspace()
            {
                MaxAltitude = 20000, MinAltitude = 500,
                Northeast   = new Corner()
                {
                    X = 90000, Y = 90000
                },
                Southwest = new Corner()
                {
                    X = 10000, Y = 10000
                }
            };

            _airspaceChecker = new AirspaceChecker(_airspace);
            _tagsManager     = new TagsManager(_airspaceChecker);
            _trackWarehouse  = new TrackWarehouse(_tagsManager, _courseCalculator,
                                                  _velocityCalculator, _tracksManager, _seperationEventChecker);
            _atmController = new AtmController(_trackTransmitter, _output, _trackWarehouse);

            _uut = new SeperationEventLogger(_output, _seperationEventChecker);

            _list = new List <string>
            {
                "ATR423;11000;11000;14000;20151006213456000",
                "ATR424;11000;11000;14000;20151006213456000"
            };

            _trackTransmitter.TrackReady += (o, args) => { _recievedTracks = args.TrackList; };

            //Act
            _transponderReceiver.TransponderDataReady +=
                Raise.EventWith(new RawTransponderDataEventArgs(_list));
        }
コード例 #3
0
        static void Main(string[] args)
        {
            var receiver       = TransponderReceiverFactory.CreateTransponderDataReceiver();
            var trackReciever  = new TrackReciever(receiver);
            var dataCalculator = new DataCalculator(trackReciever);
            var controller     = new AirTrafficController(dataCalculator);

            while (true)
            {
            }
        }
コード例 #4
0
        public void SetUp()
        {
            _airspace = new Airspace()
            {
                MaxAltitude = 20000, MinAltitude = 500, Northeast = new Corner()
                {
                    X = 90000, Y = 90000
                }, Southwest = new Corner()
                {
                    X = 10000, Y = 10000
                }
            };
            FileStream    fs         = new FileStream(@"...\...\...\Airspace.xml", FileMode.Create);
            XmlSerializer serializer = new XmlSerializer(typeof(Airspace));

            serializer.Serialize(fs, _airspace);
            fs.Close();

            _transponderReceiver = Substitute.For <ITransponderReceiver>();
            _trackTransmitter    = new TrackTransmitter();
            _dateTimeBuilder     = new DateTimeBuilder();

            _trackObjectifier = new TrackObjectifier(_dateTimeBuilder);

            _trackReciever = new TrackReciever(_transponderReceiver,
                                               _trackObjectifier, _trackTransmitter);
            _output                 = Substitute.For <IOutput>();
            _tracksManager          = new TracksManager();
            _courseCalculator       = new CourseCalculator();
            _velocityCalculator     = new VelocityCalculator();
            _seperationEventChecker = new SeperationEventChecker();
            _seperationEventLogger  = new SeperationEventLogger(_output, _seperationEventChecker);
            _uut = new AirspaceFileReader();

            _airspaceChecker = new AirspaceChecker(_uut.Read());
            _tagsManager     = new TagsManager(_airspaceChecker);
            _trackWarehouse  = new TrackWarehouse(_tagsManager, _courseCalculator,
                                                  _velocityCalculator, _tracksManager, _seperationEventChecker);
            _atmController = new AtmController(_trackTransmitter, _output, _trackWarehouse);

            _list = new List <string>
            {
                "ATR423;11000;11000;14000;20151006213456000"
            };

            _trackTransmitter.TrackReady += (o, args) => { _recievedTracks = args.TrackList; };

            //Act
            _transponderReceiver.TransponderDataReady +=
                Raise.EventWith(new RawTransponderDataEventArgs(_list));
        }
コード例 #5
0
        public void SetUp()
        {
            _nEventsRecieved     = 0;
            _transponderReceiver = Substitute.For <ITransponderReceiver>();
            _trackObjectifier    = Substitute.For <ITrackObjectifier>();
            _trackTransmitter    = Substitute.For <ITrackTransmitter>();

            _uut = new TrackReciever(_transponderReceiver, _trackObjectifier, _trackTransmitter);

            _transponderReceiver.TransponderDataReady += (o, args) =>
            {
                _nEventsRecieved++;
            };
        }
コード例 #6
0
        public void SetUp()
        {
            _transponderReceiver = Substitute.For <ITransponderReceiver>();
            _trackTransmitter    = Substitute.For <ITrackTransmitter>();
            _uut = new DateTimeBuilder();

            _trackObjectifier = new TrackObjectifier(_uut);

            _trackReciever = new TrackReciever(_transponderReceiver, _trackObjectifier, _trackTransmitter);

            _list = new List <string> {
                "ATR423;39045;12932;14000;20151006213456000"
            };
        }
コード例 #7
0
        public void SetUp()
        {
            _transponderReceiver = Substitute.For <ITransponderReceiver>();
            _trackTransmitter    = Substitute.For <ITrackTransmitter>();
            _dateTimeBuilder     = Substitute.For <IDateTimeBuilder>();

            _uut = new TrackObjectifier(_dateTimeBuilder);

            _trackReciever = new TrackReciever(_transponderReceiver, _uut, _trackTransmitter);

            _dateTimeBuilder.Build("20151006213456000").Returns(new DateTime(2015, 10, 06, 21, 34, 56));
            _list = new List <string> {
                "ATR423;39045;12932;14000;20151006213456000"
            };
        }
コード例 #8
0
        static void Main(string[] args)
        {
            var airspace = new Airspace();

            try
            {
                AirspaceFileReader airspaceFileReader = new AirspaceFileReader();

                airspace = airspaceFileReader.Read();
            }
            catch (Exception e)
            {
                Console.WriteLine("Invalid Airspace" + e.ToString());
                Console.ReadKey();
            }

            var transponderReceiver = TransponderReceiverFactory.CreateTransponderDataReceiver();

            var dateTimeBuilder  = new DateTimeBuilder();
            var trackObjectifier = new TrackObjectifier(dateTimeBuilder);

            var trackTransmitter = new TrackTransmitter();

            var trackReciever = new TrackReciever(transponderReceiver, trackObjectifier, trackTransmitter);

            var airspaceChecker = new AirspaceChecker(airspace);

            var seperationEventChecker = new SeperationEventChecker();
            var output = new Output();
            var seperationEventLogger = new SeperationEventLogger(output, seperationEventChecker);

            var courseCalculator   = new CourseCalculator();
            var velocityCalculator = new VelocityCalculator();
            var tracksManager      = new TracksManager();
            var tagsManager        = new TagsManager(airspaceChecker);


            var trackWarehouse = new TrackWarehouse(tagsManager, courseCalculator, velocityCalculator,
                                                    tracksManager, seperationEventChecker);

            var atmController = new AtmController(trackTransmitter, output, trackWarehouse);

            Console.ReadKey();
        }
コード例 #9
0
        public void SetUp()
        {
            _transponderReceiver = Substitute.For <ITransponderReceiver>();
            _uut             = new TrackTransmitter();
            _dateTimeBuilder = new DateTimeBuilder();

            _trackObjectifier = new TrackObjectifier(_dateTimeBuilder);

            _trackReciever = new TrackReciever(_transponderReceiver, _trackObjectifier, _uut);

            _list = new List <string> {
                "ATR423;39045;12932;14000;20151006213456000"
            };

            _uut.TrackReady += (o, args) => { _recievedTracks = args.TrackList; };

            // Act
            _transponderReceiver.TransponderDataReady +=
                Raise.EventWith(new RawTransponderDataEventArgs(_list));
        }
コード例 #10
0
 public void Setup()
 {
     _fakeTransponderReceiver = Substitute.For <ITransponderReceiver>();
     _uut = new TrackReciever(_fakeTransponderReceiver);
 }