Skip to content

Commit

Permalink
[Tests] Make the HttpClientTest.TestEscapedURI test ignore timeout
Browse files Browse the repository at this point in the history
The server used in the test sometimes cannot be reached, there's no need to
treat it as a failure. Ignore the timeout with Assert.Ignore instead.
  • Loading branch information
grendello committed Jan 18, 2018
1 parent 8ff139f commit 57de11f
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;

using NUnit.Framework;

Expand All @@ -19,12 +20,12 @@ public void TestUnescapedURI ()
var t = client.GetStringAsync("http://naver.com/t[e]st.txt");
t.Wait(1000);
Assert.IsNotNull(t.Result);
}
catch (AggregateException e)
{
} catch (TaskCanceledException) {
Assert.Ignore ("Connection timed out");
} catch (AggregateException e) {
Assert.AreEqual (1, e.InnerExceptions.Count);
Assert.AreEqual (typeof(HttpRequestException), e.InnerExceptions[0].GetType ());
}
}
}
}
}

0 comments on commit 57de11f

Please sign in to comment.