We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 120a6a5 commit 7885adbCopy full SHA for 7885adb
1 file changed
StyleCop.Analyzers/StyleCop.Analyzers.Test/OrderingRules/SA1213UnitTests.cs
@@ -242,5 +242,23 @@ public event EventHandler NameChanged
242
243
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
244
}
245
+
246
+ [Fact]
247
+ public async Task TestOnlyAddAccessorAsync()
248
+ {
249
+ var testCode = @"
250
+using System;
251
+public class Foo
252
+{
253
+ private EventHandler nameChanged;
254
255
+ public event EventHandler {|CS0065:NameChanged|}
256
257
+ add { this.nameChanged += value; }
258
+ }
259
+}";
260
261
+ await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
262
263
264
0 commit comments