public void Matches_Default_ReturnsFalse()
        {
            var attributeCollection = new SubAttributeCollection();

            Assert.False(attributeCollection.Matches(new ReadOnlyAttribute(true)));
            Assert.False(attributeCollection.Matches(new Attribute[] { new ReadOnlyAttribute(true) }));
        }
        public void Matches_InvokeAttributesEmpty_ReturnsExpected()
        {
            var collection = new SubAttributeCollection();

            Assert.False(collection.Matches(new Attribute[] { new BrowsableAttribute(false) }));
            Assert.False(collection.Matches(new Attribute[] { null }));
            Assert.True(collection.Matches(new Attribute[0]));
            Assert.True(collection.Matches((Attribute[])null));
        }
Esempio n. 3
0
        public void Matches_Default_ReturnsFalse()
        {
            var attributeCollection = new SubAttributeCollection();

            if (!PlatformDetection.IsFullFramework)
            {
                Assert.False(attributeCollection.Matches(new ReadOnlyAttribute(true)));
                Assert.False(attributeCollection.Matches(new Attribute[] { new ReadOnlyAttribute(true) }));
            }
            else
            {
                Assert.Throws <NullReferenceException>(() => attributeCollection.Matches(new ReadOnlyAttribute(true)));
                Assert.Throws <NullReferenceException>(() => attributeCollection.Matches(new Attribute[] { new ReadOnlyAttribute(true) }));
            }
        }