Esempio n. 1
0
        public void ShouldTakeAuthorizationAsAgrument()
        {
            var sut = new HttpEngine();

            sut.Authorization = authorization;
            var ff = sut.GetHttpResponseAsync(url).Result;
        }
Esempio n. 2
0
        public void ShouldPassAutorizationAsHeader()
        {
            var sut = new HttpEngine();

            sut.Authorization = authorization;
            var dic = (Dictionary <string, object>)sut.GetHttpResponseAsync("http://headers.jsontest.com/").Result;

            Assert.IsNotNull(dic["User-Agent"]);
        }
Esempio n. 3
0
        public void ShouldRetunDictionaryWithValues()
        {
            var sut = new HttpEngine();

            sut.Authorization = authorization;
            var dic = sut.GetHttpResponseAsync(url).Result;

            Assert.IsTrue(dic.Keys.Count > 0);
        }
 private string GetLatestVesrionFrormRemote(string url)
 {
     try
     {
         var httpEngine = new HttpEngine();
         return(httpEngine.GetResponseStringAsync(httpEngine.GetHttpResponseAsync(url).Result[DownloadUrl].ToString()).Result);
     }
     catch (WebException ex)
     {
         throw ex;
     }
 }