@@ -644,6 +644,88 @@ public interface ITest
644644 await this . VerifyCSharpFixAsync ( testCode , fixedTestCode ) . ConfigureAwait ( false ) ;
645645 }
646646
647+ [ Fact ]
648+ [ WorkItem ( 2712 , "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2712" ) ]
649+ public async Task TestExceptionElementsWithStandardFormAsync ( )
650+ {
651+ var testCode = @"
652+ using System;
653+ public interface ITest
654+ {
655+ /// <exception cref=""ArgumentNullException"">
656+ /// <para>If <paramref name=""name""/> is <see langword=""null""/></para>
657+ /// <para>-or-</para>
658+ /// <para>If <paramref name=""value""/> is <see langword=""null""/></para>
659+ /// </exception>
660+ void Method(string name, string value);
661+ }
662+ " ;
663+
664+ var fixedTestCode = @"
665+ using System;
666+ public interface ITest
667+ {
668+ /// <exception cref=""ArgumentNullException"">
669+ /// <para>If <paramref name=""name""/> is <see langword=""null""/>.</para>
670+ /// <para>-or-</para>
671+ /// <para>If <paramref name=""value""/> is <see langword=""null""/>.</para>
672+ /// </exception>
673+ void Method(string name, string value);
674+ }
675+ " ;
676+
677+ DiagnosticResult [ ] expected =
678+ {
679+ this . CSharpDiagnostic ( ) . WithLocation ( 6 , 67 ) ,
680+ this . CSharpDiagnostic ( ) . WithLocation ( 8 , 68 ) ,
681+ } ;
682+
683+ await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
684+ await this . VerifyCSharpDiagnosticAsync ( fixedTestCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
685+ await this . VerifyCSharpFixAsync ( testCode , fixedTestCode ) . ConfigureAwait ( false ) ;
686+ }
687+
688+ [ Fact ]
689+ [ WorkItem ( 2712 , "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2712" ) ]
690+ public async Task TestExceptionElementsWithAlternateFormAsync ( )
691+ {
692+ var testCode = @"
693+ using System;
694+ public interface ITest
695+ {
696+ /// <exception cref=""ArgumentNullException"">
697+ /// <para>If <paramref name=""name""/> is <see langword=""null""/></para>
698+ /// -or-
699+ /// <para>If <paramref name=""value""/> is <see langword=""null""/></para>
700+ /// </exception>
701+ void Method(string name, string value);
702+ }
703+ " ;
704+
705+ var fixedTestCode = @"
706+ using System;
707+ public interface ITest
708+ {
709+ /// <exception cref=""ArgumentNullException"">
710+ /// <para>If <paramref name=""name""/> is <see langword=""null""/>.</para>
711+ /// -or-
712+ /// <para>If <paramref name=""value""/> is <see langword=""null""/>.</para>
713+ /// </exception>
714+ void Method(string name, string value);
715+ }
716+ " ;
717+
718+ DiagnosticResult [ ] expected =
719+ {
720+ this . CSharpDiagnostic ( ) . WithLocation ( 6 , 67 ) ,
721+ this . CSharpDiagnostic ( ) . WithLocation ( 8 , 68 ) ,
722+ } ;
723+
724+ await this . VerifyCSharpDiagnosticAsync ( testCode , expected , CancellationToken . None ) . ConfigureAwait ( false ) ;
725+ await this . VerifyCSharpDiagnosticAsync ( fixedTestCode , EmptyDiagnosticResults , CancellationToken . None ) . ConfigureAwait ( false ) ;
726+ await this . VerifyCSharpFixAsync ( testCode , fixedTestCode ) . ConfigureAwait ( false ) ;
727+ }
728+
647729 protected override Project ApplyCompilationOptions ( Project project )
648730 {
649731 var resolver = new TestXmlReferenceResolver ( ) ;
0 commit comments