Exemple #1
0
        public void AddRange_NullObjectInValues_ThrowsArgumentException()
        {
            DirectoryAttribute[] attributes = new DirectoryAttribute[] { new DirectoryAttribute(), null, new DirectoryAttribute() };
            var collection = new DirectoryAttributeCollection();

            Assert.Throws <ArgumentException>(null, () => collection.AddRange(attributes));
            Assert.Equal(0, collection.Count);
        }
Exemple #2
0
        public void AddRange_ValidAttributes_AddsToCollection()
        {
            DirectoryAttribute[] attributes = new DirectoryAttribute[] { new DirectoryAttribute(), new DirectoryAttribute() };

            var collection = new DirectoryAttributeCollection();

            collection.AddRange(attributes);

            Assert.Equal(attributes, collection.Cast <DirectoryAttribute>());
        }
Exemple #3
0
        public void AddRange_NullAttributes_ThrowsArgumentNullException()
        {
            var collection = new DirectoryAttributeCollection();

            Assert.Throws <ArgumentNullException>("attributes", () => collection.AddRange((DirectoryAttribute[])null));
        }