aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Monteiro <marknr.monteiro@protonmail.com>2020-05-03 16:23:42 -0400
committerMark Monteiro <marknr.monteiro@protonmail.com>2020-05-03 16:23:42 -0400
commite66b0001830c36e83a4f2fda125264d9b9527243 (patch)
tree44aff2692b611ba578a47a64c363269d45218993 /tests
parentea82e2158c6ffda98d59d711cad36ff74ef14af8 (diff)
Enable StyleCop and FxCop analyzers for integration tests project
Use a custom ruleset that derives from the base solution ruleset, overriding rules where necessary
Diffstat (limited to 'tests')
-rw-r--r--tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs2
-rw-r--r--tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj10
-rw-r--r--tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.ruleset22
3 files changed, 33 insertions, 1 deletions
diff --git a/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs b/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs
index 558539761..c39ed07de 100644
--- a/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs
+++ b/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs
@@ -26,7 +26,7 @@ namespace MediaBrowser.Api.Tests
private static readonly ConcurrentBag<IDisposable> _disposableComponents = new ConcurrentBag<IDisposable>();
/// <summary>
- /// Initializes a new instance of <see cref="JellyfinApplicationFactory"/>.
+ /// Initializes a new instance of the <see cref="JellyfinApplicationFactory"/> class.
/// </summary>
public JellyfinApplicationFactory()
{
diff --git a/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj b/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj
index b99d61f5a..8ae110c32 100644
--- a/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj
+++ b/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj
@@ -20,4 +20,14 @@
<ProjectReference Include="..\..\MediaBrowser.Api\MediaBrowser.Api.csproj" />
</ItemGroup>
+ <!-- Code Analyzers-->
+ <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="All" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
+ </ItemGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <CodeAnalysisRuleSet>MediaBrowser.Api.Tests.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+
</Project>
diff --git a/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.ruleset b/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.ruleset
new file mode 100644
index 000000000..5cf77ac4c
--- /dev/null
+++ b/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.ruleset
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RuleSet Name="Rules for MediaBrowser.Api.Tests" Description="Code analysis rules for MediaBrowser.Api.Tests.csproj" ToolsVersion="14.0">
+
+ <!-- Include the solution default RuleSet. The rules in this file will override the defaults. -->
+ <Include Path="../../jellyfin.ruleset" Action="Default" />
+
+ <!-- StyleCop Analyzer Rules -->
+ <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
+ <!-- SA0001: XML comment analysis is disabled due to project configuration -->
+ <Rule Id="SA0001" Action="None" />
+ </Rules>
+
+ <!-- FxCop Analyzer Rules -->
+ <Rules AnalyzerId="Microsoft.CodeAnalysis.FxCopAnalyzers" RuleNamespace="Microsoft.Design">
+ <!-- CA1707: Identifiers should not contain underscores -->
+ <Rule Id="CA1707" Action="None" />
+ <!-- CA2007: Consider calling ConfigureAwait on the awaited task -->
+ <Rule Id="CA2007" Action="None" />
+ <!-- CA2234: Pass system uri objects instead of strings -->
+ <Rule Id="CA2234" Action="Info" />
+ </Rules>
+</RuleSet>