Skip to content

Commit 2d1f9c6

Browse files
CopilotEvangelink
andcommitted
Fix test location markers and assembly attribute ordering
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
1 parent 492443c commit 2d1f9c6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/UnitTests/MSTest.Analyzers.UnitTests/UseParallelizeAttributeAnalyzerTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ public async Task WhenBothAttributesSet_Diagnostic()
7474
string code = """
7575
using Microsoft.VisualStudio.TestTools.UnitTesting;
7676
77-
{|#0:[assembly: Parallelize(Workers = 2, Scope = ExecutionScope.MethodLevel)]|}
78-
{|#1:[assembly: DoNotParallelize]|}
77+
[assembly: {|#0:Parallelize(Workers = 2, Scope = ExecutionScope.MethodLevel)|}]
78+
[assembly: {|#1:DoNotParallelize|}]
7979
""";
8080

8181
await VerifyAsync(
@@ -96,8 +96,8 @@ public async Task WhenBothAttributesSetInDifferentOrder_Diagnostic()
9696
string code = """
9797
using Microsoft.VisualStudio.TestTools.UnitTesting;
9898
99-
{|#0:[assembly: DoNotParallelize]|}
100-
{|#1:[assembly: Parallelize(Workers = 2, Scope = ExecutionScope.MethodLevel)]|}
99+
[assembly: {|#0:DoNotParallelize|}]
100+
[assembly: {|#1:Parallelize(Workers = 2, Scope = ExecutionScope.MethodLevel)|}]
101101
""";
102102

103103
await VerifyAsync(
@@ -119,11 +119,11 @@ public async Task WhenBothAttributesSetWithMultipleAttributesInList_Diagnostic()
119119
using Microsoft.VisualStudio.TestTools.UnitTesting;
120120
using System;
121121
122-
[AttributeUsage(AttributeTargets.Assembly)]
123-
public class MyAsmAttribute : Attribute { }
124-
125122
[assembly: {|#0:Parallelize(Workers = 2, Scope = ExecutionScope.MethodLevel)|}, MyAsm]
126123
[assembly: {|#1:DoNotParallelize|}, MyAsm]
124+
125+
[AttributeUsage(AttributeTargets.Assembly)]
126+
public class MyAsmAttribute : Attribute { }
127127
""";
128128

129129
await VerifyAsync(

0 commit comments

Comments
 (0)