Example #1
0
        public void Private_Field_Accessed_By_Nested_Type()
        {
            var parent = new ClassWithNestedType();
            var child  = new ClassWithNestedType.NestedTypeAccessingPrivateField(parent);

            Assert.AreEqual(99, parent.AField);
        }
Example #2
0
 public NestedTypeAccessingPrivateField(ClassWithNestedType parent)
 {
     this.parent        = parent;
     this.parent.afield = 66;
 }