Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file-local class test for CA1812 #6360

Merged
merged 1 commit into from
Dec 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add file-local class test for CA1812
ahmedabdelkabier committed Dec 15, 2022
commit 3983b32a87b65f3ddb7203760210a28f691c7f48
Original file line number Diff line number Diff line change
@@ -17,6 +17,18 @@ namespace Microsoft.CodeQuality.Analyzers.Maintainability.UnitTests
{
public class AvoidUninstantiatedInternalClassesTests
{
[Fact, WorkItem(6049, "https://github.com/dotnet/roslyn-analyzers/issues/6049")]
public async Task CA1812_CSharp_Diagnostic_FileUninstantiatedInternalClassAsync()
{
const string source = "file class [|C|] { }";
await new VerifyCS.Test
{
TestCode = source,
FixedCode = source,
LanguageVersion = CodeAnalysis.CSharp.LanguageVersion.CSharp11,
}.RunAsync();
}

[Fact]
public async Task CA1812_CSharp_Diagnostic_UninstantiatedInternalClassAsync()
{