public void CreaRichiestaConSoloOrigineEDestinazione() { string origine = "43.8430139000000000,10.5079940000000530"; string destinazione = "48.2081743000000000,16.3738189000000600"; Request target = new Request(origine, destinazione); string expected = "origin=43.8430139000000000,10.5079940000000530&destination=48.2081743000000000,16.3738189000000600&sensor=false"; string actual; actual = target.ToString(); Assert.AreEqual(expected, actual); }
public void CreaRichiestaConQualcheWaypoint() { string origine = "43.8430139000000000,10.5079940000000530"; string destinazione = "48.2081743000000000,16.3738189000000600"; var waypoints = new List<String>() { "44.4070624,8.933988900000031", "44.405,8.934", "44.407,8.938", "44.409,8.936" }; Request target = new Request(origine, destinazione); target.Waypoints = waypoints; string expected = "origin=43.8430139000000000,10.5079940000000530" + "&destination=48.2081743000000000,16.3738189000000600" + "&sensor=false" + "&waypoints=44.4070624,8.933988900000031" + "|44.405,8.934" + "|44.407,8.938" + "|44.409,8.936"; string actual; actual = target.ToString(); Assert.AreEqual(expected, actual); }