コード例 #1
0
        public void CreateDirectionApiUrl_Test()
        {
            // ARANGE
            MapQuestApiProcessor mapQuestApiProcessor = new MapQuestApiProcessor();
            string actualUrl = "http://www.mapquestapi.com/directions/v2/route?key=&from=fromTest&to=toTest";

            // ACT
            string testUrl = mapQuestApiProcessor.CreateDirectionApiUrl("fromTest", "toTest", "tourNameTest");

            // ASSERT
            Assert.AreEqual(actualUrl, testUrl);
        }
コード例 #2
0
        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);
        }