@@ -22,10 +22,10 @@ public sealed class TypeIsSchemaShapeTest
22
22
public async Task ReturnTypeIsSchemaShape ( )
23
23
{
24
24
var expected = new DiagnosticResult [ ] {
25
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 23 , 13 ) . WithArguments ( "" ) ,
26
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 24 , 13 ) . WithArguments ( " of item bad" ) ,
27
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 30 , 13 ) . WithArguments ( " of item c.Item2" ) ,
28
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 40 , 13 ) . WithArguments ( " of item listen" ) ,
25
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 24 , 13 ) . WithArguments ( "" ) ,
26
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 25 , 13 ) . WithArguments ( " of item bad" ) ,
27
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 31 , 13 ) . WithArguments ( " of item c.Item2" ) ,
28
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 41 , 13 ) . WithArguments ( " of item listen" ) ,
29
29
} ;
30
30
31
31
var test = new VerifyCS . Test { TestCode = Source } ;
@@ -45,10 +45,10 @@ public async Task ReturnTypeIsSchemaShapeChained()
45
45
// function where the shape type is a generic type parameter. In this case, we would ideally like the analysis to get
46
46
// chained out of their function.
47
47
var expected = new DiagnosticResult [ ] {
48
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeParameterDiagnostic . Rule ) . WithLocation ( 18 , 24 ) . WithArguments ( "T" ) ,
49
- new DiagnosticResult ( "CS8205" , DiagnosticSeverity . Error ) . WithLocation ( 21 , 52 ) . WithMessage ( "Attributes are not allowed on local function parameters or type parameters" ) ,
50
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeParameterDiagnostic . Rule ) . WithLocation ( 41 , 24 ) . WithArguments ( "T" ) ,
51
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 55 , 26 ) . WithArguments ( " of item text" ) ,
48
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeParameterDiagnostic . Rule ) . WithLocation ( 19 , 24 ) . WithArguments ( "T" ) ,
49
+ new DiagnosticResult ( "CS8205" , DiagnosticSeverity . Error ) . WithLocation ( 22 , 52 ) . WithMessage ( "Attributes are not allowed on local function parameters or type parameters" ) ,
50
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeParameterDiagnostic . Rule ) . WithLocation ( 42 , 24 ) . WithArguments ( "T" ) ,
51
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeDiagnostic . Rule ) . WithLocation ( 56 , 26 ) . WithArguments ( " of item text" ) ,
52
52
} ;
53
53
54
54
var test = new VerifyCS . Test { TestCode = SourceChained } ;
@@ -68,17 +68,17 @@ public async Task ReturnTypeIsSchemaShapeClass()
68
68
// function where the shape type is a generic type parameter. In this case, we would ideally like the analysis to get
69
69
// chained out of their function.
70
70
var expected = new DiagnosticResult [ ] {
71
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticField . Rule ) . WithLocation ( 33 , 13 ) . WithArguments ( "Class4" , "F1" ) ,
72
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticConstructor . Rule ) . WithLocation ( 34 , 13 ) . WithArguments ( "Class5" ) ,
73
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticConstructor . Rule ) . WithLocation ( 35 , 13 ) . WithArguments ( "Class6" ) ,
71
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticField . Rule ) . WithLocation ( 34 , 13 ) . WithArguments ( "Class4" , "F1" ) ,
72
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticConstructor . Rule ) . WithLocation ( 35 , 13 ) . WithArguments ( "Class5" ) ,
73
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticConstructor . Rule ) . WithLocation ( 36 , 13 ) . WithArguments ( "Class6" ) ,
74
74
75
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticNoArgsSettable . Rule ) . WithLocation ( 36 , 13 ) . WithArguments ( "Class7" , "F1" ) ,
76
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticArgsSettable . Rule ) . WithLocation ( 37 , 13 ) . WithArguments ( "Class8" , "F2" ) ,
77
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticGettable . Rule ) . WithLocation ( 38 , 13 ) . WithArguments ( "Class9" , "F2" ) ,
78
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticCorrespondence . Rule ) . WithLocation ( 39 , 13 ) . WithArguments ( "Class10" ) ,
79
- VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticCorrespondence . Rule ) . WithLocation ( 40 , 13 ) . WithArguments ( "Class11" ) ,
75
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticNoArgsSettable . Rule ) . WithLocation ( 37 , 13 ) . WithArguments ( "Class7" , "F1" ) ,
76
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticArgsSettable . Rule ) . WithLocation ( 38 , 13 ) . WithArguments ( "Class8" , "F2" ) ,
77
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticGettable . Rule ) . WithLocation ( 39 , 13 ) . WithArguments ( "Class9" , "F2" ) ,
78
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticCorrespondence . Rule ) . WithLocation ( 40 , 13 ) . WithArguments ( "Class10" ) ,
79
+ VerifyCS . Diagnostic ( TypeIsSchemaShapeAnalyzer . ShapeClassDiagnosticCorrespondence . Rule ) . WithLocation ( 41 , 13 ) . WithArguments ( "Class11" ) ,
80
80
81
- new DiagnosticResult ( "CS0246" , DiagnosticSeverity . Error ) . WithLocation ( 44 , 71 ) . WithMessage ( "The type or namespace name 'MissingClass' could not be found (are you missing a using directive or an assembly reference?)" ) ,
81
+ new DiagnosticResult ( "CS0246" , DiagnosticSeverity . Error ) . WithLocation ( 45 , 71 ) . WithMessage ( "The type or namespace name 'MissingClass' could not be found (are you missing a using directive or an assembly reference?)" ) ,
82
82
} ;
83
83
84
84
var test = new VerifyCS . Test { TestCode = SourceClass } ;
0 commit comments