Example #1
0
        public static void TestVirtualAttributeTypeProperty()
        {
            {
                Type t = typeof(AttributeHolder1.N1).Project();
                CustomAttributeData[] cads = t.CustomAttributes.ToArray();
                Assert.Equal(1, cads.Length);
                CustomAttributeData cad = cads[0];
                Type attributeType      = cad.CallUsingReflection <Type>("get_AttributeType");
                Assert.Equal(typeof(SampleCustomAttribute).Project(), attributeType);
            }

            {
                Type t = typeof(HoldsAttributeDefinedInAnotherAssembly).Project();
                CustomAttributeData[] cads = t.CustomAttributes.ToArray();
                Assert.Equal(1, cads.Length);
                CustomAttributeData cad = cads[0];
                Type attributeType      = cad.CallUsingReflection <Type>("get_AttributeType");
                Assert.Equal(typeof(GuidAttribute).Project(), attributeType);
            }
        }