Skip to content

Commit

Permalink
Add regression test for nullable array return value
Browse files Browse the repository at this point in the history
Closes #2900
  • Loading branch information
sharwell committed Sep 3, 2019
1 parent 4ff982f commit e7ab2f3
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@ public void TestMethod()
}
}
}
";

await VerifyCSharpDiagnosticAsync(LanguageVersion.CSharp8, testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
}

[Fact]
[WorkItem(2900, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2900")]
public async Task VerifyNullableContextWithArrayReturnsAsync()
{
var testCode = @"namespace TestNamespace
{
public class TestClass
{
public byte[]? TestMethod()
{
return null;
}
}
}
";

await VerifyCSharpDiagnosticAsync(LanguageVersion.CSharp8, testCode, DiagnosticResult.EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
Expand Down

0 comments on commit e7ab2f3

Please sign in to comment.