public async void SaveRouteImageFromApi(string from, string to, string tourName) { Log.Info("SaveRouteImageFromApi method of our BL factory class is called"); MapQuestApiProcessor mapQuestApiProcessor = new MapQuestApiProcessor(); string directionsApiurl = mapQuestApiProcessor.CreateDirectionApiUrl(from, to, tourName); //calling the Directions Api: Tuple <string, string> t = await mapQuestApiProcessor.DirectionsAPI(directionsApiurl, tourName); string staticMapApiUrl = mapQuestApiProcessor.CreateStaticMapApiUrl(t.Item1, t.Item2); //calling the StaticMap Api and saving the image: mapQuestApiProcessor.StaticMapAPI(staticMapApiUrl, tourName); }
public void CreateStaticMapApiUrl_Test() { // ARANGE MapQuestApiProcessor mapQuestApiProcessor = new MapQuestApiProcessor(); string testSessionId = "abc123"; string testBoundingBox = "123456"; string actualUrl = "https://www.mapquestapi.com/staticmap/v5/map?key=&size=640,480&zoom=11&session=abc123&boundingBox=123456"; // ACT string testUrl = mapQuestApiProcessor.CreateStaticMapApiUrl(testSessionId, testBoundingBox); // ASSERT Assert.AreEqual(actualUrl, testUrl); }