コード例 #1
0
ファイル: PropertyTest.cs プロジェクト: ewin66/fasterflect-1
        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);
        }
コード例 #2
0
ファイル: PropertyTest.cs プロジェクト: ewin66/fasterflect-1
        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);
        }