Beispiel #1
0
        public void GetCustomAttributeByFullName()
        {
            // Type
            var @thisClass = new System_Object_GetCustomAttributeByFullName_TestClass();
            var @thisEnum  = System_Object_GetCustomAttributeByFullName_TestEnum.Test;

            // Exemples
            var result1 = @thisClass.GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute");
            var result2 = @thisClass.GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute", false);
            var result3 = @thisClass.GetType().GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute");
            var result4 = @thisClass.GetType().GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute", false);
            var result5 = @thisEnum.GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute");
            var result6 = @thisEnum.GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute", false);

            // Unit Test
            Assert.AreEqual("Test Class", ((System_Object_GetCustomAttributeByFullName_CustomAttribute)result1).Text);
            Assert.AreEqual("Test Class", ((System_Object_GetCustomAttributeByFullName_CustomAttribute)result2).Text);
            Assert.AreEqual("Test Class", ((System_Object_GetCustomAttributeByFullName_CustomAttribute)result3).Text);
            Assert.AreEqual("Test Class", ((System_Object_GetCustomAttributeByFullName_CustomAttribute)result4).Text);
            Assert.AreEqual("Test Enum", ((System_Object_GetCustomAttributeByFullName_CustomAttribute)result5).Text);
            Assert.AreEqual("Test Enum", ((System_Object_GetCustomAttributeByFullName_CustomAttribute)result6).Text);
        }
        public void GetCustomAttributeByFullName()
        {
            // Type
            var @thisClass = new System_Object_GetCustomAttributeByFullName_TestClass();
            var @thisEnum = System_Object_GetCustomAttributeByFullName_TestEnum.Test;

            // Exemples
            var result1 = @thisClass.GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute");
            var result2 = @thisClass.GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute", false);
            var result3 = @thisClass.GetType().GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute");
            var result4 = @thisClass.GetType().GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute", false);
            var result5 = @thisEnum.GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute");
            var result6 = @thisEnum.GetCustomAttributeByFullName("Z.Reflection.Test.System_Object_GetCustomAttributeByFullName_CustomAttribute", false);

            // Unit Test
            Assert.AreEqual("Test Class", ((System_Object_GetCustomAttributeByFullName_CustomAttribute) result1).Text);
            Assert.AreEqual("Test Class", ((System_Object_GetCustomAttributeByFullName_CustomAttribute) result2).Text);
            Assert.AreEqual("Test Class", ((System_Object_GetCustomAttributeByFullName_CustomAttribute) result3).Text);
            Assert.AreEqual("Test Class", ((System_Object_GetCustomAttributeByFullName_CustomAttribute) result4).Text);
            Assert.AreEqual("Test Enum", ((System_Object_GetCustomAttributeByFullName_CustomAttribute) result5).Text);
            Assert.AreEqual("Test Enum", ((System_Object_GetCustomAttributeByFullName_CustomAttribute) result6).Text);
        }