Skip to content

Commit 5ecef98

Browse files
committed
Add a test for ArgumentException (type from a different assembly)
1 parent fd402ad commit 5ecef98

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1648UnitTests.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public Base() { }
2727
2828
class Test : Base
2929
{
30-
/// <inheritdoc />
30+
/// <inheritdoc/>
3131
public Test() { }
3232
}";
3333

@@ -45,7 +45,7 @@ public Base(string s, int a) { }
4545
4646
class Test : Base
4747
{
48-
/// <inheritdoc />
48+
/// <inheritdoc/>
4949
public Test(string s, int b)
5050
: base(s, b) { }
5151
}
@@ -59,7 +59,7 @@ public async Task TestConstructorInheritsImplicitlyFromSystemObjectAsync()
5959
{
6060
var testCode = @"class Test
6161
{
62-
/// <inheritdoc />
62+
/// <inheritdoc/>
6363
public Test() { }
6464
}";
6565

@@ -71,13 +71,25 @@ public async Task TestConstructorInheritsExplicitlyFromSystemObjectAsync()
7171
{
7272
var testCode = @"class Test : System.Object
7373
{
74-
/// <inheritdoc />
74+
/// <inheritdoc/>
7575
public Test() { }
7676
}";
7777

7878
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
7979
}
8080

81+
[Fact]
82+
public async Task TestConstructorInheritsExplicitlyFromTypeInDifferentAssemblyAsync()
83+
{
84+
var testCode = @"class MyArgumentException : System.ArgumentException
85+
{
86+
/// <inheritdoc/>
87+
public MyArgumentException() { }
88+
}";
89+
90+
await VerifyCSharpDiagnosticAsync(testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
91+
}
92+
8193
[Fact]
8294
public async Task TestClassOverridesClassAsync()
8395
{

0 commit comments

Comments
 (0)