* Stylecop Rules and Fixes
This commit is contained in:
Qstick
2020-01-03 07:49:24 -05:00
committed by GitHub
parent 63d669178d
commit f77a2feeef
1307 changed files with 8704 additions and 7404 deletions
@@ -21,15 +21,15 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
public void Setup()
{
Subject.Definition = new IndexerDefinition()
{
Id = 5,
Name = "Newznab",
Settings = new NewznabSettings()
{
Id = 5,
Name = "Newznab",
Settings = new NewznabSettings()
{
BaseUrl = "http://indexer.local/",
Categories = new int[] { 1 }
}
};
BaseUrl = "http://indexer.local/",
Categories = new int[] { 1 }
}
};
_caps = new NewznabCapabilities();
Mocker.GetMock<INewznabCapabilitiesProvider>()
@@ -45,7 +45,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
var releases = Subject.FetchRecent();
releases.Should().HaveCount(100);
@@ -93,5 +93,5 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
ExceptionVerification.ExpectedWarns(1);
}
}
}
}
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Moq;
@@ -19,16 +18,15 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
Subject.Settings = new NewznabSettings()
{
BaseUrl = "http://127.0.0.1:1234/",
Categories = new [] { 1, 2 },
ApiKey = "abcd",
BaseUrl = "http://127.0.0.1:1234/",
Categories = new[] { 1, 2 },
ApiKey = "abcd",
};
_singleAlbumSearchCriteria = new AlbumSearchCriteria
{
Artist = new Music.Artist { Name = "Alien Ant Farm" },
AlbumTitle = "TruANT"
};
_capabilities = new NewznabCapabilities();
@@ -53,7 +51,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
[Test]
public void should_search_by_artist_and_album_if_supported()
{
_capabilities.SupportedAudioSearchParameters = new[] { "q", "artist", "album"};
_capabilities.SupportedAudioSearchParameters = new[] { "q", "artist", "album" };
var results = Subject.GetSearchRequests(_singleAlbumSearchCriteria);
results.GetTier(0).Should().HaveCount(1);
@@ -7,7 +7,6 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
public class NewznabSettingFixture : CoreTest
{
[TestCase("http://nzbs.org")]
[TestCase("http:///www.nzbplanet.net")]
public void requires_apikey(string url)
@@ -18,10 +17,8 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
BaseUrl = url
};
setting.Validate().IsValid.Should().BeFalse();
setting.Validate().Errors.Should().Contain(c => c.PropertyName == "ApiKey");
}
[TestCase("")]
@@ -35,14 +32,11 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
BaseUrl = url
};
setting.Validate().IsValid.Should().BeFalse();
setting.Validate().Errors.Should().NotContain(c => c.PropertyName == "ApiKey");
setting.Validate().Errors.Should().Contain(c => c.PropertyName == "BaseUrl");
}
[TestCase("http://nzbs2.org")]
public void doesnt_requires_apikey(string url)
{
@@ -52,7 +46,6 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
BaseUrl = url
};
setting.Validate().IsValid.Should().BeTrue();
}
}