예제 #1
0
        public void TestFieldInstanceIgnoreCase()
        {
            Flags flags = Flags.InstanceAnyVisibility | Flags.IgnoreCase;

            AnimalInstanceFieldNames.Select(s => s.ToUpper()).Select(s => typeof(Animal).Field(s, flags)).ForEach(Assert.NotNull);
            LionInstanceFieldNames.Select(s => s.ToUpper()).Select(s => typeof(Lion).Field(s, flags)).ForEach(Assert.NotNull);
        }
예제 #2
0
        public void TestFieldInstance()
        {
            FieldInfo field = typeof(object).Field("id");

            Assert.Null(field);

            AnimalInstanceFieldNames.Select(s => typeof(Animal).Field(s)).ForEach(Assert.NotNull);
            LionInstanceFieldNames.Select(s => typeof(Lion).Field(s)).ForEach(Assert.NotNull);
        }