Esempio n. 1
0
        public void Tracker_FiresEventsAndUpdatesCoords()
        {
            GeoCoordinate startPoint = new GeoCoordinate(-40, -40);
            GeoCoordinate endPoint = new GeoCoordinate(-40.00001, -40.00001);

            MockConsumer mck = new MockConsumer();
            VehicleTracker trk = new VehicleTracker(new GeoCoordinate[] { startPoint, endPoint });

            mck.Subscribe(trk);
            trk.StartTracker();

            Assert.AreEqual(mck.latitude, endPoint.Latitude);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // Must contain at least 2 valid coordinates
            GeoCoordinate[] waypoints = new GeoCoordinate[]
            {
                new GeoCoordinate(38.048196, -121.089409),
                new GeoCoordinate(38.041013, -121.091238),
                new GeoCoordinate(37.984013, -121.103238)
            };

            VehicleTracker gpsTracker = new VehicleTracker(waypoints);

            Vehicle car = new Vehicle();
            car.Subscribe(gpsTracker);

            gpsTracker.StartTracker();
        }