Exemple #1
0
 public HandleRTD(ITransponderReceiver receiver, IAirspace CheckPlanes, IDetectSeparationEvent detect) // Changed to IAirspace
 {
     Receiver = receiver;
     Receiver.TransponderDataReady += OnDataReady;
     _CheckPlanes          = CheckPlanes;
     detectSeparationEvent = detect;
 }
        public void Setup()
        {
            fakeDetectSeparationEvent = Substitute.For <IDetectSeparationEvent>();
            fakeAirspace    = Substitute.For <IAirspace>();
            fakeCheckPlanes = Substitute.For <ICheckPlanes>();

            uut = new Log(fakeDetectSeparationEvent, fakeAirspace, fakeCheckPlanes);
            uut.ClearLog();
        }
Exemple #3
0
 public Renedition(IDetectSeparationEvent detectSep, ICheckPlanes detectEnter, IAirspace detectLeave)
 {
     DetectSep = detectSep;
     DetectSep.RaisedSerparationEvent += HandleSeparationEvent;
     DetectEnter = detectEnter;
     DetectEnter.RaisedEnterEvent += HandelEnterEvent;
     DetectLeave = detectLeave;
     DetectLeave.RaisedLeaveEvent += HandleLeaveEvent;
 }
Exemple #4
0
        public void SetUp()
        {
            fakeDetectSeparationEvent = Substitute.For <IDetectSeparationEvent>();
            uut             = new Renedition();
            testPlane       = Substitute.For <IPlane>();
            testPlane2      = Substitute.For <IPlane>();
            fakeCheckPlanes = Substitute.For <ICheckPlanes>();
            fakeAirspace    = Substitute.For <IAirspace>();
            nEventsReceived = 0;
            receivedData    = new EnterEventArgs.Msg();
            testPlane       = new Plane()
            {
                Course      = 0,
                Altitude    = 14000,
                Tag         = "ATR423",
                XCoordinate = 39045,
                YCoordinate = 12932,
                Velocity    = 0,
                TimeStamp   = DateTime.ParseExact("20151006123456789", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)
            };

            testPlane2 = new Plane()
            {
                Course      = 0,
                Altitude    = 15000,
                Tag         = "BRW500",
                XCoordinate = 30000,
                YCoordinate = 10000,
                Velocity    = 0,
                TimeStamp   = DateTime.ParseExact("20181006123456789", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)
            };

            listOPlanes = new List <IPlane>();
            listOPlanes.Add(testPlane);

            fakeCheckPlanes.RaisedEnterEvent += (o, args) =>
            {
                receivedData = args.Message;
                ++nEventsReceived;
            };

            fakeAirspace.RaisedLeaveEvent += (o, args) =>
            {
                receivedData2 = args.Message;
                ++nEventsReceived;
            };
        }
Exemple #5
0
        public Log(IDetectSeparationEvent detectSepEvent, IAirspace detectLeaveEvent, ICheckPlanes detectEnterEvent)
        {
            IDetectSeparationEvent DetectSepEvent;

            DetectSepEvent = detectSepEvent;
            DetectSepEvent.RaisedSerparationEvent += WriteSeperationToLog;

            IAirspace DetectLeaveEvent;

            DetectLeaveEvent = detectLeaveEvent;
            DetectLeaveEvent.RaisedLeaveEvent += WriteLeavingPlaneToLog;

            ICheckPlanes DetectEnterEvent;

            DetectEnterEvent = detectEnterEvent;
            DetectEnterEvent.RaisedEnterEvent += WriteEnteredPlaneToLog;
        }
Exemple #6
0
 public void SetUp()
 {
     fakeTransponderReceiver   = Substitute.For <ITransponderReceiver>();
     fakeAirspace              = Substitute.For <IAirspace>();
     fakeDetectSeparationEvent = Substitute.For <IDetectSeparationEvent>();
     uut             = new HandleRTD(fakeTransponderReceiver, fakeAirspace, fakeDetectSeparationEvent);
     testPlaneString = "ATR423;39045;12932;14000;20151006123456789";
     testPlane       = new Plane()
     {
         Course      = 0,
         Altitude    = 14000,
         Tag         = "ATR423",
         XCoordinate = 39045,
         YCoordinate = 12932,
         Velocity    = 0,
         TimeStamp   = DateTime.ParseExact("20151006123456789", "yyyyMMddHHmmssfff", CultureInfo.InvariantCulture)
     };
 }
        public void SetUp()
        {
            nEventsReceived = 0;
            receivedData    = new List <string>();
            testData        = new List <string>();
            testData2       = new List <string>();


            fakeDetectSeparationEvent = Substitute.For <IDetectSeparationEvent>();
            fakeTransponderReceiver   = Substitute.For <ITransponderReceiver>();
            fakeAirspace = Substitute.For <IAirspace>();
            uut          = new HandleRTD(fakeTransponderReceiver, fakeAirspace, fakeDetectSeparationEvent);
            testData.Add("ATR423;39045;12932;14000;20151006123456789");
            testData2.Add("BTR523;40000;20000;10000;20181006123456789");

            fakeTransponderReceiver.TransponderDataReady += (o, args) =>
            {
                receivedData = args.TransponderData;
                ++nEventsReceived;
            };
        }
        public void SetUp()
        {
            nEventsReceived = 0;
            receivedData    = new SeperationsEventArgs.Msg();
            Timestamp       = "20181006123456789";

            fakeDetectSeparationEvent = Substitute.For <IDetectSeparationEvent>();
            fakePlane1 = Substitute.For <IPlane>();
            fakePlane2 = Substitute.For <IPlane>();

            fakePlane1 = new Plane()
            {
                Course      = 0,
                Altitude    = 14900,
                Tag         = "ATR423",
                XCoordinate = 39045,
                YCoordinate = 12932,
                Velocity    = 0,
            };

            fakePlane2 = new Plane()
            {
                Course      = 0,
                Altitude    = 15000,
                Tag         = "BRW500",
                XCoordinate = 39000,
                YCoordinate = 13000,
                Velocity    = 0,
            };

            uut = new DetectSeparationEvent();

            fakeDetectSeparationEvent.RaisedSerparationEvent += (o, args) =>
            {
                receivedData = args.Message;
                ++nEventsReceived;
            };
        }