Skip to content

Commit b81aade

Browse files
committed
Fix tests.
1 parent 81cd479 commit b81aade

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

AspNetCoreAnalyzers.Tests/DocumentationTests.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ namespace AspNetCoreAnalyzers.Tests
1717

1818
public class DocumentationTests
1919
{
20-
private static readonly IReadOnlyList<DiagnosticAnalyzer> Analyzers = typeof(AnalyzerCategory)
21-
.Assembly
22-
.GetTypes()
23-
.Where(t => typeof(DiagnosticAnalyzer).IsAssignableFrom(t))
24-
.OrderBy(x => x.Name)
25-
.Select(t => (DiagnosticAnalyzer)Activator.CreateInstance(t))
26-
.ToArray();
20+
private static readonly IReadOnlyList<DiagnosticAnalyzer> Analyzers =
21+
typeof(AnalyzerCategory)
22+
.Assembly
23+
.GetTypes()
24+
.Where(t => typeof(DiagnosticAnalyzer).IsAssignableFrom(t) && !t.IsAbstract)
25+
.OrderBy(x => x.Name)
26+
.Select(t => (DiagnosticAnalyzer)Activator.CreateInstance(t))
27+
.ToArray();
2728

2829
private static readonly IReadOnlyList<DescriptorInfo> DescriptorInfos = Analyzers
2930
.SelectMany(DescriptorInfo.Create)

AspNetCoreAnalyzers.Tests/Repro.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace AspNetCoreAnalyzers.Tests
1+
namespace AspNetCoreAnalyzers.Tests
22
{
33
using System;
44
using System.Collections.Generic;
@@ -13,9 +13,11 @@ namespace AspNetCoreAnalyzers.Tests
1313
public static class Repro
1414
{
1515
////ReSharper disable once UnusedMember.Local
16-
private static readonly IReadOnlyList<DiagnosticAnalyzer> AllAnalyzers = typeof(Descriptors)
17-
.Assembly.GetTypes()
18-
.Where(typeof(DiagnosticAnalyzer).IsAssignableFrom)
16+
private static readonly IReadOnlyList<DiagnosticAnalyzer> AllAnalyzers =
17+
typeof(Descriptors)
18+
.Assembly
19+
.GetTypes()
20+
.Where(t => typeof(DiagnosticAnalyzer).IsAssignableFrom(t) && !t.IsAbstract)
1921
.Select(t => (DiagnosticAnalyzer)Activator.CreateInstance(t))
2022
.ToArray();
2123

0 commit comments

Comments
 (0)