Exemplo n.º 1
0
        public void should_access_public_memeber_in_derived_class()
        {
            var demoClass = new InheritMemberAccessDemoClass();

            // please change the variable value to fix the test.
            const string expected = "";

            Assert.Equal(expected, demoClass.PublicProperty);
        }
Exemplo n.º 2
0
        public void should_access_protected_member_in_derived_class()
        {
            var demoClass = new InheritMemberAccessDemoClass();

            string actualValue = demoClass.ManipulateProtectedMember();

            // please change the variable value to fix the test.
            const string expected = "";

            Assert.Equal(expected, actualValue);
        }
Exemplo n.º 3
0
        public void should_get_most_derived_type_when_call_get_type_method()
        {
            var derivedClassObject = new InheritMemberAccessDemoClass();
            var castedToBaseClass = (InheritMemberAccessDemoBaseClass)derivedClassObject;

            Type type = castedToBaseClass.GetType();

            // change the variable value to fix the test.
            Type expectedType = typeof(InheritMemberAccessDemoBaseClass);

            Assert.Equal(expectedType, type);
        }