예제 #1
0
 public void HttpRequestFailShouldReturnResponseString()
 {
     var t = new HttpClient("https://raw.githubusercontent.com", new HttpRequester(), new UrlHelper());
     t.EnableDebugInformationInException = true;
     try
     {
         t.DoRequest<SlApi.Models.TravelPlanner.JourneyDirections>("/arins/dotNetSlApi/master/SlApi/SlApi.Tests/TestData/HttpClientTest/invalidJson.json");
     }
     catch (Exception ex)
     {
         Assert.IsTrue(ex is HttpRequestException);
         var hex = (HttpRequestException) ex;
         Assert.IsTrue(hex.Response?.Equals(GetSampleResponse("TestData\\HttpClientTest\\invalidJson.json")) ?? false);
     }
 }