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));
        }
        public void Setup()
        {
            _tagsManager            = Substitute.For <ITagsManager>();
            _courseCalculator       = Substitute.For <ICourseCalculator>();
            _velocityCalculator     = Substitute.For <IVelocityCalculator>();
            _tracksManager          = Substitute.For <ITracksManager>();
            _seperationEventChecker = Substitute.For <ISeperationEventChecker>();
            _uut = new TrackWarehouse(_tagsManager, _courseCalculator,
                                      _velocityCalculator, _tracksManager, _seperationEventChecker);

            _tracks = new List <Track> {
                new Track()
                {
                    Tag = "1"
                },
                new Track()
                {
                    Tag = "2"
                },
                new Track()
                {
                    Tag = "1"
                }
            };

            _tags = new List <string> {
                "1", "2"
            };
            // Det gør ingen forskel, hvad der står i x.Manage()
            _tagsManager.WhenForAnyArgs(x => x.Manage(ref _tags, _tracks))
            .Do(x => x[0] = _tags);
        }
Ejemplo n.º 3
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));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 5
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();
        }