GetField() public static method

public static GetField ( this type, string fieldName ) : FieldInfo
type this
fieldName string
return FieldInfo
Ejemplo n.º 1
0
        public void ReflectionExtensionsGetField()
        {
            tlog.Debug(tag, $"ReflectionExtensionsGetField START");

            try
            {
                TypeImplement type = new TypeImplement();

                ReflectionExtensions.GetField(type, "myName");
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                tlog.Debug(tag, $"ReflectionExtensionsGetField END (OK)");
                Assert.Pass("Caught Exception : passed!");
            }
        }
Ejemplo n.º 2
0
        public void GetField()
        {
            tlog.Debug(tag, $"GetField START");

            try
            {
                var ret = ReflectionExtensions.GetField(typeof(View), "backgroundExtraData");
                Assert.IsNotNull(ret, "Should not be null");
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            tlog.Debug(tag, $"GetField END");
        }