@@ -17,7 +17,6 @@ public interface ITestInterface
1717{
1818 void TestMethod();
1919}" ;
20- // Warning for missing OSInterface attribute - spans the interface declaration
2120 var expected = CSharpAnalyzerVerifier < Analyzer > . Diagnostic ( DiagnosticIds . NoSingleInterface )
2221 . WithSpan ( 2 , 1 , 5 , 2 ) ;
2322
@@ -35,7 +34,6 @@ public interface ITestInterface
3534 void TestMethod();
3635 }
3736}" ;
38- // Warning for missing OSInterface attribute - spans the interface declaration
3937 var expected = CSharpAnalyzerVerifier < Analyzer > . Diagnostic ( DiagnosticIds . NoSingleInterface )
4038 . WithSpan ( 4 , 5 , 7 , 6 ) ;
4139
@@ -69,7 +67,6 @@ public class SecondImplementation : ISecondInterface
6967{
7068 public void TestMethod() { }
7169}" ;
72- // Warning for multiple OSInterface attributes - spans the first interface's entire declaration
7370 var expected = CSharpAnalyzerVerifier < Analyzer > . Diagnostic ( DiagnosticIds . ManyInterfaces )
7471 . WithSpan ( 2 , 1 , 6 , 2 )
7572 . WithArguments ( "IFirstInterface, ISecondInterface" ) ;
@@ -106,7 +103,6 @@ public class SecondImplementation : ISecondInterface
106103 public void TestMethod() { }
107104 }
108105}" ;
109- // Warning for multiple OSInterface attributes - spans the first interface's declaration
110106 var expected = CSharpAnalyzerVerifier < Analyzer > . Diagnostic ( DiagnosticIds . ManyInterfaces )
111107 . WithSpan ( 4 , 5 , 8 , 6 )
112108 . WithArguments ( "IFirstInterface, ISecondInterface" ) ;
@@ -144,7 +140,6 @@ public class SecondImplementation : ISecondInterface
144140 public void TestMethod() { }
145141 }
146142}" ;
147- // Warning for multiple OSInterface attributes across namespaces - spans the first interface's declaration
148143 var expected = CSharpAnalyzerVerifier < Analyzer > . Diagnostic ( DiagnosticIds . ManyInterfaces )
149144 . WithSpan ( 4 , 5 , 8 , 6 )
150145 . WithArguments ( "IFirstInterface, ISecondInterface" ) ;
@@ -168,7 +163,6 @@ public class TestImplementation : ITestInterface
168163{
169164 public void TestMethod() { }
170165}" ;
171- // Warning for non-public interface with OSInterface - spans the entire interface declaration
172166 var expected = CSharpAnalyzerVerifier < Analyzer > . Diagnostic ( DiagnosticIds . NonPublicInterface )
173167 . WithSpan ( 2 , 1 , 6 , 2 )
174168 . WithArguments ( "ITestInterface" ) ;
@@ -193,7 +187,6 @@ public class TestImplementation : ITestInterface
193187 public void TestMethod() { }
194188 }
195189}" ;
196- // Warning for non-public interface with OSInterface in namespace - spans the interface declaration
197190 var expected = CSharpAnalyzerVerifier < Analyzer > . Diagnostic ( DiagnosticIds . NonPublicInterface )
198191 . WithSpan ( 4 , 5 , 8 , 6 )
199192 . WithArguments ( "ITestInterface" ) ;
@@ -269,7 +262,7 @@ public interface ITestInterface
269262}" ;
270263 var expected = CSharpAnalyzerVerifier < Analyzer >
271264 . Diagnostic ( DiagnosticIds . MissingImplementation )
272- . WithSpan ( 2 , 1 , 6 , 2 ) // Adjusted span
265+ . WithSpan ( 2 , 1 , 6 , 2 )
273266 . WithArguments ( "ITestInterface" ) ;
274267
275268 await CSharpAnalyzerVerifier < Analyzer > . VerifyAnalyzerAsync ( test , TestContext , skipSDKreference : false , expected ) ;
@@ -289,7 +282,7 @@ public interface ITestInterface
289282}" ;
290283 var expected = CSharpAnalyzerVerifier < Analyzer >
291284 . Diagnostic ( DiagnosticIds . MissingImplementation )
292- . WithSpan ( 4 , 5 , 8 , 6 ) // Adjusted span
285+ . WithSpan ( 4 , 5 , 8 , 6 )
293286 . WithArguments ( "ITestInterface" ) ;
294287
295288 await CSharpAnalyzerVerifier < Analyzer > . VerifyAnalyzerAsync ( test , TestContext , skipSDKreference : false , expected ) ;
@@ -939,13 +932,11 @@ public struct TestStruct
939932}" ;
940933 var expected = new [ ]
941934 {
942- // Warning for private field with OSStructureField - spans the field name
943935 CSharpAnalyzerVerifier < Analyzer >
944936 . Diagnostic ( DiagnosticIds . UnsupportedTypeMapping )
945937 . WithSpan ( 6 , 16 , 6 , 21 )
946938 . WithArguments ( "Value" ) ,
947939
948- // Warning for internal property with OSStructureField - spans the property name
949940 CSharpAnalyzerVerifier < Analyzer >
950941 . Diagnostic ( DiagnosticIds . UnsupportedTypeMapping )
951942 . WithSpan ( 9 , 19 , 9 , 23 )
@@ -1077,7 +1068,6 @@ public class TestImplementation : IThisExternalLibraryNameIsMuchTooLongAndExceed
10771068{
10781069 public void Method() { }
10791070}" ;
1080- // Warning for interface name too long (after removing 'I' prefix) - spans interface declaration
10811071 var expected = CSharpAnalyzerVerifier < Analyzer >
10821072 . Diagnostic ( DiagnosticIds . NameMaxLengthExceeded )
10831073 . WithSpan ( 2 , 1 , 6 , 2 )
@@ -1102,7 +1092,6 @@ public class TestImplementation : ITestInterface
11021092{
11031093 public void Method() { }
11041094}" ;
1105- // Warning for name starting with number - spans the interface declaration
11061095 var expected = CSharpAnalyzerVerifier < Analyzer >
11071096 . Diagnostic ( DiagnosticIds . NameBeginsWithNumbers )
11081097 . WithSpan ( 2 , 1 , 6 , 2 )
@@ -1128,7 +1117,6 @@ public class TestImplementation : ITestInterface
11281117{
11291118 public void Method() { }
11301119}" ;
1131- // Warning for invalid characters in name - spans the interface declaration
11321120 var expected = CSharpAnalyzerVerifier < Analyzer >
11331121 . Diagnostic ( DiagnosticIds . UnsupportedCharactersInName )
11341122 . WithSpan ( 2 , 1 , 6 , 2 )
@@ -1360,7 +1348,7 @@ public async Task ComplexScenario_MultipleNamingAndStructureIssues_ReportsWarnin
13601348namespace Company.ExternalLibs.Data
13611349{
13621350 [OSStructure]
1363- public struct CustomStruct // Changed to public to avoid compiler errors
1351+ public struct CustomStruct
13641352 {
13651353 internal int Value; // Non-public field
13661354 [OSStructureField]
@@ -1485,10 +1473,10 @@ public struct ResultStruct
14851473namespace Company.ExternalLibs.Utils
14861474{
14871475 [OSStructure]
1488- public struct DuplicateStruct
1476+ public struct DuplicateStruct // Duplicate structure name
14891477 {
14901478 public string Name;
1491- } // Duplicate structure name
1479+ }
14921480}
14931481
14941482namespace Company.ExternalLibs.Interfaces
@@ -1503,7 +1491,7 @@ public interface IDataProcessor
15031491
15041492 public class DataProcessor : IDataProcessor
15051493 {
1506- public DataProcessor() { } // Added public parameterless constructor
1494+ public DataProcessor() { }
15071495
15081496 public List<ResultStruct> ProcessData(InputStruct data)
15091497 {
@@ -1513,7 +1501,7 @@ public List<ResultStruct> ProcessData(InputStruct data)
15131501}" ;
15141502 var expected = new [ ]
15151503 {
1516- // Empty structure
1504+ // EmptyStructure
15171505 CSharpAnalyzerVerifier < Analyzer >
15181506 . Diagnostic ( DiagnosticIds . EmptyStructure )
15191507 . WithSpan ( 7 , 19 , 7 , 34 )
@@ -1525,19 +1513,19 @@ public List<ResultStruct> ProcessData(InputStruct data)
15251513 . WithSpan ( 31 , 20 , 31 , 31 )
15261514 . WithArguments ( "StringValue" ) ,
15271515
1528- // Unsupported parameter type (InputStruct)
1516+ // UnsupportedParameterType
15291517 CSharpAnalyzerVerifier < Analyzer >
15301518 . Diagnostic ( DiagnosticIds . UnsupportedParameterType )
15311519 . WithSpan ( 34 , 28 , 34 , 39 )
15321520 . WithArguments ( "ResultStruct" , "Company.ExternalLibs.Models.InputStruct" ) ,
15331521
1534- // Duplicate structure name
1522+ // DuplicateName
15351523 CSharpAnalyzerVerifier < Analyzer >
15361524 . Diagnostic ( DiagnosticIds . DuplicateName )
15371525 . WithSpan ( 41 , 19 , 41 , 34 )
15381526 . WithArguments ( "DuplicateStruct, DuplicateStruct" , "DuplicateStruct" ) ,
15391527
1540- // Missing OSStructure decoration
1528+ // MissingStructureDecoration
15411529 CSharpAnalyzerVerifier < Analyzer >
15421530 . Diagnostic ( DiagnosticIds . MissingStructureDecoration )
15431531 . WithSpan ( 54 , 40 , 54 , 56 )
0 commit comments