public void GetEnumerator_ShouldReturnAGenericEnumerator()
        {
            List<ConfigurationElementMock> list = new List<ConfigurationElementMock>
            {
                new ConfigurationElementMock(),
                new ConfigurationElementMock(),
                new ConfigurationElementMock()
            };

            ConfigurationElementCollectionMock configurationElementCollection = new ConfigurationElementCollectionMock();

            foreach(ConfigurationElementMock configurationElement in list)
            {
                configurationElementCollection.BaseAdd(configurationElement);
            }

            IEnumerator<ConfigurationElementMock> listEnumerator = list.GetEnumerator();
            IEnumerator<ConfigurationElementMock> enumerator = configurationElementCollection.GetEnumerator();

            while(listEnumerator.MoveNext())
            {
                enumerator.MoveNext();
                Assert.AreEqual(listEnumerator.Current, enumerator.Current);
            }

            Assert.IsFalse(listEnumerator.MoveNext());
            Assert.IsFalse(enumerator.MoveNext());
        }
        public void GetEnumerator_IfTheConfigurationElementCollectionContainsItemsThatIsNotOfTheGenericType_ShouldThrowAnInvalidCastException()
        {
            ConfigurationElementCollectionMock configurationElementCollection = new ConfigurationElementCollectionMock();
            configurationElementCollection.BaseAdd(new ConfigurationElementMock());
            configurationElementCollection.BaseAdd(Mock.Of<ConfigurationElement>());
            configurationElementCollection.BaseAdd(new ConfigurationElementMock());

            // ReSharper disable ReturnValueOfPureMethodIsNotUsed
            // ReSharper disable IteratorMethodResultIsIgnored
            configurationElementCollection.GetEnumerator();
            // ReSharper restore IteratorMethodResultIsIgnored
            // ReSharper restore ReturnValueOfPureMethodIsNotUsed
        }