Exemple #1
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;
            };
        }
        public void SetUp()
        {
            receivedData = new EnterEventArgs.Msg();


            nEventsReceived   = 0;
            newfakePlanes     = new List <IPlane>();
            currentfakePlanes = new List <IPlane>();
            time1             = new DateTime(2010, 10, 10, 00, 01, 00);
            time2             = new DateTime(2010, 10, 10, 00, 02, 00);


            fakePlane1             = new Plane();
            fakePlane1.Tag         = "ABC123";
            fakePlane1.XCoordinate = 1000;
            fakePlane1.YCoordinate = 1000;
            fakePlane1.Altitude    = 17100;
            fakePlane1.TimeStamp   = time1;



            currentfakePlanes.Add(fakePlane1);
            fakeCalculateCourse   = Substitute.For <ICalculateCourse>();
            fakeCalculateVelocity = Substitute.For <ICalculateVelocity>();
            fakeRenedition        = Substitute.For <IRenedition>();
            fakeIEnterEvent       = Substitute.For <IEnterEvent>();
            uut = new CheckPlanes(fakeCalculateVelocity, fakeCalculateCourse, fakeRenedition);

            fakeListOfTags = CheckPlanes.ListOfTags;


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