Example #1
0
        public void TestPropertyInstance()
        {
            PropertyInfo property = typeof(object).Property("ID");

            Assert.IsNull(property);

            AnimalInstancePropertyNames.Select(s => typeof(Animal).Property(s)).ForEach(Assert.IsNotNull);
            LionInstancePropertyNames.Select(s => typeof(Lion).Property(s)).ForEach(Assert.IsNotNull);
        }
Example #2
0
        public void TestPropertyInstanceIgnoreCase()
        {
            Flags flags = Flags.InstanceAnyVisibility | Flags.IgnoreCase;

            AnimalInstancePropertyNames.Select(s => s.ToLower()).Select(s => typeof(Animal).Property(s)).ForEach(Assert.IsNull);
            AnimalInstancePropertyNames.Select(s => s.ToLower()).Select(s => typeof(Animal).Property(s, flags)).ForEach(Assert.IsNotNull);

            LionInstancePropertyNames.Select(s => s.ToLower()).Select(s => typeof(Lion).Property(s)).ForEach(Assert.IsNull);
            LionInstancePropertyNames.Select(s => s.ToLower()).Select(s => typeof(Lion).Property(s, flags)).ForEach(Assert.IsNotNull);
        }