mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-27 22:57:09 -04: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>()))
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using NUnit.Framework;
|
||||
using FluentAssertions;
|
||||
using NzbDrone.Test.Common;
|
||||
using System;
|
||||
using System.Text;
|
||||
using NzbDrone.Common.Http;
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Common.Test.Http
|
||||
{
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace NzbDrone.Common.Test.Http
|
||||
var request = builder.Resource("/v1/").Build();
|
||||
|
||||
request.Url.FullUri.Should().Be("http://domain/v1/");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user