Exemple #1
0
 public void EnumerateEmptyCollection()
 {
     var collection = new SimpleCollection();
     Assert.Empty(collection);
     var enumerator = collection.GetEnumerator();
     Assert.False(enumerator.MoveNext());
 }
Exemple #2
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());
 }