mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Reformat and apply Stylecop rules
This commit is contained in:
@@ -22,7 +22,8 @@ namespace NzbDrone.Common.Test.Http
|
||||
{
|
||||
[IntegrationTest]
|
||||
[TestFixture(typeof(ManagedHttpDispatcher))]
|
||||
public class HttpClientFixture<TDispatcher> : TestBase<HttpClient> where TDispatcher : IHttpDispatcher
|
||||
public class HttpClientFixture<TDispatcher> : TestBase<HttpClient>
|
||||
where TDispatcher : IHttpDispatcher
|
||||
{
|
||||
private string[] _httpBinHosts;
|
||||
private int _httpBinSleep;
|
||||
@@ -34,6 +35,7 @@ namespace NzbDrone.Common.Test.Http
|
||||
public void FixtureSetUp()
|
||||
{
|
||||
var candidates = new[] { "eu.httpbin.org", /*"httpbin.org",*/ "www.httpbin.org" };
|
||||
|
||||
// httpbin.org is broken right now, occassionally redirecting to https if it's unavailable.
|
||||
_httpBinHosts = candidates.Where(IsTestSiteAvailable).ToArray();
|
||||
|
||||
@@ -48,7 +50,10 @@ namespace NzbDrone.Common.Test.Http
|
||||
{
|
||||
var req = WebRequest.Create($"http://{site}/get") as HttpWebRequest;
|
||||
var res = req.GetResponse() as HttpWebResponse;
|
||||
if (res.StatusCode != HttpStatusCode.OK) return false;
|
||||
if (res.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -60,7 +65,10 @@ namespace NzbDrone.Common.Test.Http
|
||||
res = ex.Response as HttpWebResponse;
|
||||
}
|
||||
|
||||
if (res == null || res.StatusCode != (HttpStatusCode)429) return false;
|
||||
if (res == null || res.StatusCode != (HttpStatusCode)429)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -617,7 +625,7 @@ namespace NzbDrone.Common.Test.Http
|
||||
[Test]
|
||||
public void should_call_interceptor()
|
||||
{
|
||||
Mocker.SetConstant<IEnumerable<IHttpRequestInterceptor>>(new [] { Mocker.GetMock<IHttpRequestInterceptor>().Object });
|
||||
Mocker.SetConstant<IEnumerable<IHttpRequestInterceptor>>(new[] { Mocker.GetMock<IHttpRequestInterceptor>().Object });
|
||||
|
||||
Mocker.GetMock<IHttpRequestInterceptor>()
|
||||
.Setup(v => v.PreRequest(It.IsAny<HttpRequest>()))
|
||||
|
Reference in New Issue
Block a user