public void Ctor_InvalidCustomValues() { VehicleTracker trk = new VehicleTracker(new GeoCoordinate[] { new GeoCoordinate(-40, -40), new GeoCoordinate(-40, -40) }, -1, 15, 5, 5, 5, 5); }
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); }
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(); }
public void Ctor_InvalidCoordinateFormat() { VehicleTracker trk = new VehicleTracker(new GeoCoordinate[] { new GeoCoordinate(-1000, -1000) }); }
public void Ctor_InvalidCoordinateQuantity() { VehicleTracker trk = new VehicleTracker(new GeoCoordinate[] { new GeoCoordinate(-1, -1) }); }
public void Subscribe(VehicleTracker theTracker) { theTracker.PositionChange += new VehicleTracker.PositionChangeHandler(PositionHasChanged); }