예제 #1
0
        public void GetPropertyValue()
        {
            var propertyOrFieldReflection = new ClassToAnalyze(1, 1, 1).Reflection().GetPropertyOrField("PrivateProperty");
            var value = propertyOrFieldReflection.GetValue <string>();

            value.Should().Be("PrivateProperty");
        }
예제 #2
0
        public void SetFieldValue()
        {
            var propertyOrFieldReflection = new ClassToAnalyze(1, 1, 1).Reflection().GetPropertyOrField("_privateField");

            propertyOrFieldReflection.SetValue("test");
            var value = propertyOrFieldReflection.GetValue <string>();

            value.Should().Be("test");
        }