Exemple #1
0
        public void EnumGetAttributesReturnsEmptyArrayIfNoAttributeOnEnumField()
        {
            TestEnum value = TestEnum.Zero;

            TestEnumTwoAttribute[] attributes = value.GetAttributes <TestEnumTwoAttribute>();

            Assert.IsNotNull(attributes);
            Assert.IsEmpty(attributes);
        }
Exemple #2
0
        public void EnumGetAttributesReturnsEmptyArrayIfSpecifiedAttributeIsNotOnEnumField()
        {
            TestEnum value = TestEnum.One;

            TestEnumTwoAttribute[] attributes = value.GetAttributes <TestEnumTwoAttribute>();

            Assert.IsNotNull(attributes);
            Assert.IsEmpty(attributes);
        }
Exemple #3
0
        public void EnumGetAttributesReturnsArrayIfAttributeOnEnumField()
        {
            const int expectedLength = 2;

            TestEnum value = TestEnum.Two;

            TestEnumTwoAttribute[] attributes = value.GetAttributes <TestEnumTwoAttribute>();

            Assert.IsNotNull(attributes);
            Assert.AreEqual(expectedLength, attributes.Length);
        }