public void CheckRestClientFailGet(string url) { IRest client = new RestClient(); RequestException exception = Assert.Throws <RequestException>(() => client.Get(new RestRequest(url))); Assert.That(exception.Message, Is.Not.Null.Or.Empty); }
public void CheckRestClientSuccessGet() { IRest client = new RestClient(); IRestResponse response = client.Get(new RestRequest("https://google.pl")); Assert.AreEqual(response.StatusCode, HttpStatusCode.OK); Assert.True(response.IsSuccessful); }