public void MapTimedViewModel_Initialize_CorrectRoute() { var data = Factories.GetRouteData(); var model = new MapTimedViewModel(data); model.Initialize(); model.SliderValueChanged(2); List <Microsoft.Maps.MapControl.WPF.MapPolyline> locations = new List <Microsoft.Maps.MapControl.WPF.MapPolyline>(); var arrow = new Microsoft.Maps.MapControl.WPF.MapPolyline(); var line = new Microsoft.Maps.MapControl.WPF.MapPolyline(); Setup(line); line.Locations = new LocationCollection(); for (int i = 0; i < 2; i++) { var loc = data.Route.ElementAt(i); line.Locations.Add(new Location(loc)); } arrow = GetArrow(data.Route.First(), data.Route.ElementAt(1)); locations.Add(line); locations.Add(arrow); Assert.IsTrue(CompareMapPolylines.compare(locations.ElementAt(0), model.MapPolylines.ElementAt(0))); Assert.IsTrue(CompareMapPolylines.compare(locations.ElementAt(1), model.MapPolylines.ElementAt(1))); }
public void MapTimedViewModel_Initialize_CorrectMapZoomLevel() { var data = Factories.GetRouteData(); var model = new MapTimedViewModel(data); model.Initialize(); Assert.AreEqual(12.6d, Math.Round(model.MapZoomLevel, 1)); }
public void MapTimedViewModel_Initialize_CorrectAPIKey() { var data = Factories.GetRouteData(); var model = new MapTimedViewModel(data); model.Initialize(); Assert.AreEqual(new ApplicationIdCredentialsProvider("FRANZ-OTTO").ToString(), model.APIKey.ToString()); }
public void MapTimedViewModel_Initialize_CorrectMapCenter() { var data = Factories.GetRouteData(); var model = new MapTimedViewModel(data); model.Initialize(); Assert.AreEqual(new Location(0, 0), model.MapCenter); }
/// <summary> /// This is the constructor of the MapTimed page /// </summary> /// <param name="data"></param> public MapTimed(DataProvider data) { InitializeComponent(); model = new MapTimedViewModel(data); this.DataContext = model; model.RouteChangedEvent += Model_RouteChangedEvent; model.Initialize(); map.SetView(model.MapCenter, model.MapZoomLevel); }