95 references to CSharpSecurityCodeFixVerifier
Microsoft.CodeAnalysis.Analyzers.UnitTests (24)
MetaAnalyzers\CompareSymbolsCorrectlyTests.cs (24)
10
using VerifyCS = Test.Utilities.
CSharpSecurityCodeFixVerifier
<
226
await new
VerifyCS
.Test
237
=>
VerifyCS
.VerifyCodeFixAsync($$"""
258
=>
VerifyCS
.VerifyAnalyzerAsync($$"""
285
await new
VerifyCS
.Test
314
await new
VerifyCS
.Test
343
await new
VerifyCS
.Test
356
=>
VerifyCS
.VerifyAnalyzerAsync($$"""
373
=>
VerifyCS
.VerifyAnalyzerAsync($$"""
548
await new
VerifyCS
.Test
608
await new
VerifyCS
.Test
712
await new
VerifyCS
.Test
772
await new
VerifyCS
.Test
801
await new
VerifyCS
.Test
811
await
VerifyCS
.VerifyAnalyzerAsync("""
836
await new
VerifyCS
.Test
1014
await new
VerifyCS
.Test
1287
=> new
VerifyCS
.Test
1321
=> new
VerifyCS
.Test
1345
=> new
VerifyCS
.Test
1377
=> new
VerifyCS
.Test
1458
await new
VerifyCS
.Test
1510
await new
VerifyCS
.Test
1590
await new
VerifyCS
.Test
Roslyn.Diagnostics.Analyzers.UnitTests (71)
DoNotCallGetTestAccessorTests.cs (4)
7
using VerifyCS = Test.Utilities.
CSharpSecurityCodeFixVerifier
<
20
=>
VerifyCS
.VerifyAnalyzerAsync("""
72
=>
VerifyCS
.VerifyAnalyzerAsync("""
122
=>
VerifyCS
.VerifyAnalyzerAsync("""
DoNotCopyValueTests.cs (63)
10
using VerifyCS = Test.Utilities.
CSharpSecurityCodeFixVerifier
<
23
=> new
VerifyCS
.Test
44
await
VerifyCS
.VerifyAnalyzerAsync("""
74
await
VerifyCS
.VerifyAnalyzerAsync($$"""
110
await
VerifyCS
.VerifyAnalyzerAsync($$"""
142
await
VerifyCS
.VerifyAnalyzerAsync($$"""
156
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.NoAssignValueFromReferenceRule).WithLocation(0).WithArguments("System.Runtime.InteropServices.GCHandle"));
181
await
VerifyCS
.VerifyAnalyzerAsync($$"""
221
await
VerifyCS
.VerifyAnalyzerAsync($$"""
253
=>
VerifyCS
.VerifyAnalyzerAsync("""
267
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.NoAssignValueFromReferenceRule).WithLocation(0).WithArguments("System.Runtime.InteropServices.GCHandle"));
271
=>
VerifyCS
.VerifyAnalyzerAsync("""
299
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(0).WithArguments("System.Runtime.InteropServices.GCHandle", "FieldReference"),
301
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(1).WithArguments("System.Runtime.InteropServices.GCHandle", "LocalReference"));
305
=>
VerifyCS
.VerifyAnalyzerAsync("""
333
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(0).WithArguments("System.Runtime.InteropServices.GCHandle", "FieldReference"),
335
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(1).WithArguments("System.Runtime.InteropServices.GCHandle", "LocalReference"));
339
=>
VerifyCS
.VerifyAnalyzerAsync("""
387
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(0).WithArguments("System.Runtime.InteropServices.GCHandle", "FieldReference"),
389
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(1).WithArguments("System.Runtime.InteropServices.GCHandle", "LocalReference"),
391
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(2).WithArguments("System.Runtime.InteropServices.GCHandle", "FieldReference"),
393
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(3).WithArguments("System.Runtime.InteropServices.GCHandle", "FieldReference"),
395
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(4).WithArguments("System.Runtime.InteropServices.GCHandle", "LocalReference"),
397
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(5).WithArguments("System.Runtime.InteropServices.GCHandle", "LocalReference"),
399
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(6).WithArguments("System.Runtime.InteropServices.GCHandle", "LocalReference"));
406
=>
VerifyCS
.VerifyAnalyzerAsync($$"""
418
await
VerifyCS
.VerifyAnalyzerAsync("""
440
=>
VerifyCS
.VerifyAnalyzerAsync("""
451
=>
VerifyCS
.VerifyAnalyzerAsync("""
484
=> new
VerifyCS
.Test
503
=> new
VerifyCS
.Test
608
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(0).WithArguments("CannotCopy", "FieldReference"),
615
=> new
VerifyCS
.Test
635
=> new
VerifyCS
.Test
655
=> new
VerifyCS
.Test
682
=> new
VerifyCS
.Test
724
("in", "") => [
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(0).WithArguments("CannotCopy", "ParameterReference")],
729
var test = new
VerifyCS
.Test
767
=> new
VerifyCS
.Test
804
=> new
VerifyCS
.Test
847
=> new
VerifyCS
.Test
898
=> new
VerifyCS
.Test
936
=> new
VerifyCS
.Test
965
=> new
VerifyCS
.Test
996
=> new
VerifyCS
.Test
1032
await new
VerifyCS
.Test
1063
=> new
VerifyCS
.Test
1097
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.NoAssignValueFromReferenceRule).WithLocation(0).WithArguments("CannotCopy"),
1099
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.NoAssignValueFromReferenceRule).WithLocation(1).WithArguments("CannotCopy"),
1106
=> new
VerifyCS
.Test
1132
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.NoReturnValueFromReferenceRule).WithLocation(0).WithArguments("CannotCopy"),
1139
=>
VerifyCS
.VerifyAnalyzerAsync("""
1166
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(0).WithArguments("CannotCopy", "FieldReference"));
1170
=>
VerifyCS
.VerifyAnalyzerAsync("""
1179
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.AvoidNullableWrapperRule).WithLocation(0).WithArguments("System.Runtime.InteropServices.GCHandle?", "FieldInitializer"));
1184
await
VerifyCS
.VerifyAnalyzerAsync("""
1209
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.NoFieldOfCopyableTypeRule).WithLocation(0).WithArguments("CannotCopy", "C2.field2"));
1239
await
VerifyCS
.VerifyAnalyzerAsync("""
1261
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.NoAutoPropertyRule).WithLocation(0).WithArguments("CannotCopy", "C1.Property3"),
1263
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.NoAutoPropertyRule).WithLocation(1).WithArguments("CannotCopy", "C2.Property3"));
1326
=> new
VerifyCS
.Test
1377
=> new
VerifyCS
.Test
1430
VerifyCS
.Diagnostic(AbstractDoNotCopyValue.UnsupportedUseRule).WithLocation(0).WithArguments("S", "LocalReference")
TemporaryArrayAsRefTests.cs (4)
8
using VerifyCS = Test.Utilities.
CSharpSecurityCodeFixVerifier
<
78
await new
VerifyCS
.Test
131
await new
VerifyCS
.Test
158
await new
VerifyCS
.Test