예제 #1
0
        public void TestReplaceAccessTokenWhenNothingToReplace()
        {
            var url = "https://api.mercadolibre.com/moderations/denounces/MLB11378/ITM/options?first=value&another=one";

            var request = new HttpRequestMessage(HttpMethod.Post, new Uri(url));

            MeliApiService.ReplaceAccessToken(request, "new_token_value");

            Assert.AreEqual("https://api.mercadolibre.com/moderations/denounces/MLB11378/ITM/options?first=value&another=one", request.RequestUri.AbsoluteUri);
        }
예제 #2
0
        public void TestReplaceAccessToken()
        {
            var url = "https://api.mercadolibre.com/moderations/denounces/MLB11378/ITM/options?first=value&access_token=APP_USR-5128891793554461-041805-e0dd11044b96a343fcb6b1361800bbb0__F_A__-191075056&another=one";

            var request = new HttpRequestMessage(HttpMethod.Post, new Uri(url));

            MeliApiService.ReplaceAccessToken(request, "new_token_value");

            Assert.AreEqual("https://api.mercadolibre.com/moderations/denounces/MLB11378/ITM/options?first=value&access_token=new_token_value&another=one", request.RequestUri.AbsoluteUri);
        }