예제 #1
0
        public void DifferentCountNotEqual()
        {
            var collection = new SimpleCollection();

            collection.TestBaseAdd(SimpleCollection.TestElement);
            Assert.False(new SimpleCollection().Equals(collection));
        }
예제 #2
0
        public void AddBaseElementAtIndexSucceeds()
        {
            var collection = new SimpleCollection();

            collection.TestBaseAdd(-1, new SimpleElement());
            Assert.Equal(1, collection.Count);
        }
예제 #3
0
        public void BaseIndexReturnsZeroForOneItem()
        {
            var collection = new SimpleCollection();

            collection.TestBaseAdd(SimpleCollection.TestElement);
            Assert.Equal(0, collection.TestBaseIndexOf(SimpleCollection.TestElement));
        }
예제 #4
0
 public void CopyToCopiesItem()
 {
     var collection = new SimpleCollection();
     collection.TestBaseAdd(SimpleCollection.TestElement);
     ConfigurationElement[] array = new ConfigurationElement[1];
     collection.CopyTo(array, 0);
     Assert.Equal(SimpleCollection.TestElement, array.GetValue(0));
 }
예제 #5
0
 public void EnumerateNonEmptyCollection()
 {
     var collection = new SimpleCollection();
     collection.TestBaseAdd(SimpleCollection.TestElement);
     Assert.NotEmpty(collection);
     var enumerator = collection.GetEnumerator();
     Assert.True(enumerator.MoveNext());
     Assert.Equal(SimpleCollection.TestElement, enumerator.Current);
     Assert.False(enumerator.MoveNext());
 }