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
instead.
From the IsPublic()
MSDN documentation:
Do not use with nested types; use
IsNestedPublic
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With