public void GetUrl_waypoints_latlng_ex2() { var req = new DirectionRequestAccessor(); req.Sensor = false; req.Origin = "NY"; req.Destination = "Orlando,FL"; req.Mode = TravelMode.driving; //this is default, so querystring doesn't need to contain it. req.AddWaypoint("NJ"); req.AddWaypoint(new LatLng(28.452694, -80.979195)); req.AddWaypoint("Sarasota,FL"); Uri expected = new Uri("json?origin=NY&destination=Orlando,FL&waypoints=NJ|28.452694,-80.979195|Sarasota,FL&sensor=false", UriKind.Relative); Uri actual = req.ToUri(); Assert.AreEqual(expected, actual); }
public void GetUrl_waypoints_latlng_ex2() { //arrange var expected = ParseQueryString("json?origin=NY&destination=Orlando,FL&waypoints=NJ|28.452694,-80.979195|Sarasota,FL&sensor=false"); var req = new DirectionRequestAccessor(); req.Sensor = false; req.Origin = "NY"; req.Destination = "Orlando,FL"; req.Mode = TravelMode.driving; //this is default, so querystring doesn't need to contain it. req.AddWaypoint("NJ"); req.AddWaypoint(new LatLng(28.452694, -80.979195)); req.AddWaypoint("Sarasota,FL"); //act var actual = ParseQueryString(req.ToUri()); //assert Assert.That(actual, Is.EquivalentTo(expected)); }
public void GetUrl_waypoints_simple_ex1() { var req = new DirectionRequestAccessor(); req.Sensor = false; req.Origin = "NY"; req.Destination = "FL"; req.Mode = TravelMode.driving; //this is default, so querystring doesn't need to contain it. req.AddWaypoint("NC"); Uri expected = new Uri("json?origin=NY&destination=FL&waypoints=NC&sensor=false", UriKind.Relative); Uri actual = req.ToUri(); Assert.AreEqual(expected, actual); }
public void GetUrl_waypoints_simple_ex1() { //arrange var expected = ParseQueryString("json?origin=NY&destination=FL&waypoints=NC&sensor=false"); var req = new DirectionRequestAccessor(); req.Sensor = false; req.Origin = "NY"; req.Destination = "FL"; req.Mode = TravelMode.driving; //this is default, so querystring doesn't need to contain it. req.AddWaypoint("NC"); //act var actual = ParseQueryString(req.ToUri()); //assert Assert.That(actual, Is.EquivalentTo(expected)); }