AKA, why does this test fail?
[TestFixture] public class Tests { [Test] public void InnerClassShouldBePublic() { Assert.IsTrue(typeof (InnerClass).IsPublic); } public class InnerClass { } }
It fails because nested types are not considered Public , they are considered NestedPublic.
NestedPublic
From the IsPublic()MSDN Documentation :
IsPublic()
Do not use with nested types; use instead IsNestedPublic.
IsNestedPublic