Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }