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)); } }
public void PerformASuccessfulGetRequest() { var webClient = new SecureWebClient(SECRET_KEY, SHARED_KEY, BASE_ADDRESS); var dataStream = webClient.OpenRead(BASE_ADDRESS.AbsoluteUri); }