Reformat and apply Stylecop rules

This commit is contained in:
ta264
2019-12-22 22:08:53 +00:00
committed by Qstick
parent d4fa9b7345
commit f02fa629cc
1186 changed files with 7105 additions and 5616 deletions

View File

@@ -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>()))