Exemplo n.º 1
0
        public void ConstructorReadOnlyTests()
        {
            var descriptors = new EventDescriptor[]
            {
                new MockEventDescriptor("descriptor1")
            };

            var collection = new EventDescriptorCollection(descriptors, true);

            Assert.Equal(descriptors, collection.Cast <EventDescriptor>());

            // These methods are implemented as explicit properties so we need to ensure they are what we expect
            Assert.True(((IList)collection).IsReadOnly);
            Assert.True(((IList)collection).IsFixedSize);
        }
        public void ConstructorReadOnlyTests()
        {
            var descriptors = new EventDescriptor[]
            {
                new MockEventDescriptor("descriptor1")
            };

            var collection = new EventDescriptorCollection(descriptors, true);

            Assert.Equal(descriptors, collection.Cast<EventDescriptor>());

            // These methods are implemented as explicit properties so we need to ensure they are what we expect
            Assert.True(((IList)collection).IsReadOnly);
            Assert.True(((IList)collection).IsFixedSize);
        }