System.Tests.GetCustomAttribute.PositiveTest2 C# (CSharp) Method

PositiveTest2() private method

private PositiveTest2 ( ) : void
return void
        public static void PositiveTest2()
        {
            Assembly element = typeof(AttributeGetCustomAttributes).Assembly;
            Type attributeType = typeof(AssemblyDescriptionAttribute);
            AssemblyDescriptionAttribute attributeVal = (AssemblyDescriptionAttribute)Attribute.GetCustomAttribute(element, attributeType, false);
            Assert.True(attributeVal != null);

            attributeType = typeof(AssemblyCopyrightAttribute);
            AssemblyCopyrightAttribute attributeVal1 = (AssemblyCopyrightAttribute)Attribute.GetCustomAttribute(element, attributeType, false);
            Assert.True(attributeVal1 != null);

            attributeType = typeof(AssemblyCompanyAttribute);
            AssemblyCompanyAttribute attributeVal2 = (AssemblyCompanyAttribute)Attribute.GetCustomAttribute(element, attributeType, false);
            Assert.True(attributeVal2 != null);

            attributeType = typeof(AssemblyKeyNameAttribute);
            Attribute attributeVal3 = Attribute.GetCustomAttribute(element, attributeType, false);
            Assert.True(attributeVal3 == null);

            attributeType = typeof(AssemblyInformationalVersionAttribute);
            attributeVal3 = Attribute.GetCustomAttribute(element, attributeType, false);
            Assert.True(attributeVal3 != null);
        }