コード例 #1
0
        public void StructInstance_StructField_Get_Test()
        {
            var fakes = new StructFieldFakes();

            fakes.StructField = 100;
            var field          = typeof(StructFieldFakes).GetTypeInfo().GetField("StructField");
            var fieldReflector = field.GetReflector();
            var fieldValue     = fieldReflector.GetValue(fakes);

            Assert.Equal(100, fieldValue);
        }
コード例 #2
0
        public void StructInstance_Field_Get_Test()
        {
            var fakes = new StructFieldFakes();

            fakes.ClassField = "Lemon";
            var field          = typeof(StructFieldFakes).GetTypeInfo().GetField("ClassField");
            var fieldReflector = field.GetReflector();
            var fieldValue     = fieldReflector.GetValue(fakes);

            Assert.Equal("Lemon", fieldValue);
        }