Skip to content

Commit 119bb15

Browse files
committed
applied comments
1 parent eb20be9 commit 119bb15

17 files changed

+61
-60
lines changed

src/Analyzers/MSTest.Analyzers/AnalyzerReleases.Unshipped.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ MSTEST0011 | Usage | Warning | ClassCleanupShouldBeValidAnalyzer, [Documentation
1212
MSTEST0012 | Usage | Warning | AssemblyInitializeShouldBeValidAnalyzer, [Documentation](https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0012)
1313
MSTEST0013 | Usage | Warning | AssemblyCleanupShouldBeValidAnalyzer, [Documentation](https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0013)
1414
MSTEST0014 | Usage | Warning | DataRowShouldBeValidAnalyzer, [Documentation](https://learn.microsoft.com/dotnet/core/testing/unit-testing-mstest-analyzers-MSTEST0014)
15-
MSTEST0015 | Design | Info | TestMethodShouldNotBeIgnoredAnalyzer
15+
MSTEST0015 | Design | Info | TestMethodShouldNotBeIgnoredAnalyzer, [Documentation](https://learn.microsoft.com/dotnet/core/testing/unit-testing-mstest-analyzers-MSTEST0015)

src/Analyzers/MSTest.Analyzers/Resources.Designer.cs

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Analyzers/MSTest.Analyzers/Resources.resx

+2-2
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,10 @@
446446
<value>Test methods should have valid layout</value>
447447
</data>
448448
<data name="TestMethodShouldNotBeIgnoredAnalyzerDescription" xml:space="preserve">
449-
<value>Test methods should not be ignored (marked with [Ignore]).</value>
449+
<value>Test methods should not be ignored (marked with '[Ignore]').</value>
450450
</data>
451451
<data name="TestMethodShouldNotBeIgnoredAnalyzerFormat" xml:space="preserve">
452-
<value>Test Method {0} should not be ignored</value>
452+
<value>Test method '{0}' should not be ignored</value>
453453
</data>
454454
<data name="TestMethodShouldNotBeIgnoredAnalyzerTitle" xml:space="preserve">
455455
<value>Test method should not be ignored</value>

src/Analyzers/MSTest.Analyzers/TestMethodShouldNotBeIgnoredAnalyzer.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public sealed class TestMethodShouldNotBeIgnoredAnalyzer : DiagnosticAnalyzer
2929
isEnabledByDefault: true);
3030

3131
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }
32-
= ImmutableArray.Create(TestMethodShouldNotBeIgnoredRule);
32+
= ImmutableArray.Create(TestMethodShouldNotBeIgnoredRule);
3333

3434
public override void Initialize(AnalysisContext context)
3535
{
@@ -50,8 +50,9 @@ public override void Initialize(AnalysisContext context)
5050
private static void AnalyzeSymbol(SymbolAnalysisContext context, INamedTypeSymbol ignoreAttributeSymbol, INamedTypeSymbol testMethodAttributeSymbol)
5151
{
5252
var methodSymbol = (IMethodSymbol)context.Symbol;
53-
if (!methodSymbol.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, testMethodAttributeSymbol))
54-
|| !methodSymbol.GetAttributes().Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, ignoreAttributeSymbol)))
53+
var methodAttributes = methodSymbol.GetAttributes();
54+
if (!methodAttributes.Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, testMethodAttributeSymbol))
55+
|| !methodAttributes.Any(attr => SymbolEqualityComparer.Default.Equals(attr.AttributeClass, ignoreAttributeSymbol)))
5556
{
5657
return;
5758
}

src/Analyzers/MSTest.Analyzers/xlf/Resources.cs.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -572,13 +572,13 @@
572572
<note />
573573
</trans-unit>
574574
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
575-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
576-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
575+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
576+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
577577
<note />
578578
</trans-unit>
579579
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
580-
<source>Test Method {0} should not be ignored</source>
581-
<target state="new">Test Method {0} should not be ignored</target>
580+
<source>Test method '{0}' should not be ignored</source>
581+
<target state="new">Test method '{0}' should not be ignored</target>
582582
<note />
583583
</trans-unit>
584584
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.de.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@
570570
<note />
571571
</trans-unit>
572572
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
573-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
574-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
573+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
574+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
575575
<note />
576576
</trans-unit>
577577
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
578-
<source>Test Method {0} should not be ignored</source>
579-
<target state="new">Test Method {0} should not be ignored</target>
578+
<source>Test method '{0}' should not be ignored</source>
579+
<target state="new">Test method '{0}' should not be ignored</target>
580580
<note />
581581
</trans-unit>
582582
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.es.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@
570570
<note />
571571
</trans-unit>
572572
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
573-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
574-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
573+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
574+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
575575
<note />
576576
</trans-unit>
577577
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
578-
<source>Test Method {0} should not be ignored</source>
579-
<target state="new">Test Method {0} should not be ignored</target>
578+
<source>Test method '{0}' should not be ignored</source>
579+
<target state="new">Test method '{0}' should not be ignored</target>
580580
<note />
581581
</trans-unit>
582582
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@
570570
<note />
571571
</trans-unit>
572572
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
573-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
574-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
573+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
574+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
575575
<note />
576576
</trans-unit>
577577
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
578-
<source>Test Method {0} should not be ignored</source>
579-
<target state="new">Test Method {0} should not be ignored</target>
578+
<source>Test method '{0}' should not be ignored</source>
579+
<target state="new">Test method '{0}' should not be ignored</target>
580580
<note />
581581
</trans-unit>
582582
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.it.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@
570570
<note />
571571
</trans-unit>
572572
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
573-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
574-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
573+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
574+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
575575
<note />
576576
</trans-unit>
577577
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
578-
<source>Test Method {0} should not be ignored</source>
579-
<target state="new">Test Method {0} should not be ignored</target>
578+
<source>Test method '{0}' should not be ignored</source>
579+
<target state="new">Test method '{0}' should not be ignored</target>
580580
<note />
581581
</trans-unit>
582582
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.ja.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,13 @@
571571
<note />
572572
</trans-unit>
573573
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
574-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
575-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
574+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
575+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
576576
<note />
577577
</trans-unit>
578578
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
579-
<source>Test Method {0} should not be ignored</source>
580-
<target state="new">Test Method {0} should not be ignored</target>
579+
<source>Test method '{0}' should not be ignored</source>
580+
<target state="new">Test method '{0}' should not be ignored</target>
581581
<note />
582582
</trans-unit>
583583
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.ko.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,13 @@
571571
<note />
572572
</trans-unit>
573573
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
574-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
575-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
574+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
575+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
576576
<note />
577577
</trans-unit>
578578
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
579-
<source>Test Method {0} should not be ignored</source>
580-
<target state="new">Test Method {0} should not be ignored</target>
579+
<source>Test method '{0}' should not be ignored</source>
580+
<target state="new">Test method '{0}' should not be ignored</target>
581581
<note />
582582
</trans-unit>
583583
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.pl.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@
570570
<note />
571571
</trans-unit>
572572
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
573-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
574-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
573+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
574+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
575575
<note />
576576
</trans-unit>
577577
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
578-
<source>Test Method {0} should not be ignored</source>
579-
<target state="new">Test Method {0} should not be ignored</target>
578+
<source>Test method '{0}' should not be ignored</source>
579+
<target state="new">Test method '{0}' should not be ignored</target>
580580
<note />
581581
</trans-unit>
582582
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.pt-BR.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@
570570
<note />
571571
</trans-unit>
572572
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
573-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
574-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
573+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
574+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
575575
<note />
576576
</trans-unit>
577577
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
578-
<source>Test Method {0} should not be ignored</source>
579-
<target state="new">Test Method {0} should not be ignored</target>
578+
<source>Test method '{0}' should not be ignored</source>
579+
<target state="new">Test method '{0}' should not be ignored</target>
580580
<note />
581581
</trans-unit>
582582
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.ru.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@
570570
<note />
571571
</trans-unit>
572572
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
573-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
574-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
573+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
574+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
575575
<note />
576576
</trans-unit>
577577
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
578-
<source>Test Method {0} should not be ignored</source>
579-
<target state="new">Test Method {0} should not be ignored</target>
578+
<source>Test method '{0}' should not be ignored</source>
579+
<target state="new">Test method '{0}' should not be ignored</target>
580580
<note />
581581
</trans-unit>
582582
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.tr.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -572,13 +572,13 @@
572572
<note />
573573
</trans-unit>
574574
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
575-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
576-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
575+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
576+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
577577
<note />
578578
</trans-unit>
579579
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
580-
<source>Test Method {0} should not be ignored</source>
581-
<target state="new">Test Method {0} should not be ignored</target>
580+
<source>Test method '{0}' should not be ignored</source>
581+
<target state="new">Test method '{0}' should not be ignored</target>
582582
<note />
583583
</trans-unit>
584584
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hans.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@
570570
<note />
571571
</trans-unit>
572572
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
573-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
574-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
573+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
574+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
575575
<note />
576576
</trans-unit>
577577
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
578-
<source>Test Method {0} should not be ignored</source>
579-
<target state="new">Test Method {0} should not be ignored</target>
578+
<source>Test method '{0}' should not be ignored</source>
579+
<target state="new">Test method '{0}' should not be ignored</target>
580580
<note />
581581
</trans-unit>
582582
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hant.xlf

+4-4
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,13 @@
570570
<note />
571571
</trans-unit>
572572
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerDescription">
573-
<source>Test methods should not be ignored (marked with [Ignore]).</source>
574-
<target state="new">Test methods should not be ignored (marked with [Ignore]).</target>
573+
<source>Test methods should not be ignored (marked with '[Ignore]').</source>
574+
<target state="new">Test methods should not be ignored (marked with '[Ignore]').</target>
575575
<note />
576576
</trans-unit>
577577
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerFormat">
578-
<source>Test Method {0} should not be ignored</source>
579-
<target state="new">Test Method {0} should not be ignored</target>
578+
<source>Test method '{0}' should not be ignored</source>
579+
<target state="new">Test method '{0}' should not be ignored</target>
580580
<note />
581581
</trans-unit>
582582
<trans-unit id="TestMethodShouldNotBeIgnoredAnalyzerTitle">

0 commit comments

Comments
 (0)