예제 #1
0
 public void SendTimedOutRequestAndRecieveUnauthorizedResponse()
 {
     try
     {
         var webClient   = new SecureWebClient(SECRET_KEY, SHARED_KEY, BASE_ADDRESS);
         var timeToSleep = GetRequestTimeOut();
         Thread.Sleep(timeToSleep);
         var dataStream = webClient.OpenRead(BASE_ADDRESS.AbsoluteUri);
     }
     catch (WebException ex)
     {
         var statusCode = ((HttpWebResponse)ex.Response).StatusCode;
         Assert.IsTrue(HttpStatusCode.Unauthorized.Equals(statusCode));
     }
 }
예제 #2
0
 public void PerformASuccessfulGetRequest()
 {
     var webClient  = new SecureWebClient(SECRET_KEY, SHARED_KEY, BASE_ADDRESS);
     var dataStream = webClient.OpenRead(BASE_ADDRESS.AbsoluteUri);
 }