Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit 401149c

Browse files
committed
Regression test for nested struct visibility
Added a regression test to ensure a nested struct is tagged with private visibility instead of internal. Related to #70
1 parent 3cd238b commit 401149c

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/Microsoft.DotNet.CodeFormatting.Tests/Rules/ExplicitVisibilityRuleTests.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,32 @@ internal class C
390390

391391
Verify(text, expected, runFormatter: false);
392392
}
393+
394+
[Fact]
395+
public void Issue70()
396+
{
397+
var source = @"
398+
public class MyClass
399+
{
400+
enum MyEnum { }
401+
struct MyStruct
402+
{
403+
public MyStruct(MyEnum e) { }
404+
}
405+
}";
406+
407+
var expected = @"
408+
public class MyClass
409+
{
410+
private enum MyEnum { }
411+
private struct MyStruct
412+
{
413+
public MyStruct(MyEnum e) { }
414+
}
415+
}";
416+
417+
Verify(source, expected);
418+
}
393419
}
394420

395421
public sealed class VisualBasicTests : ExplicitVisibilityRuleTests

0 commit comments

Comments
 (0)