public void ShouldNotEnumerateButReturnOne_WhenCollectionIsSingleton() { // Arrange var collection = new CheckingCollection <string>(new [] { "a" }); var smartList = new SmartList <string>(collection); // Act var count = smartList.Count; // Assert Assert.Equal(1, count); Assert.False(collection.Enumerated); }
public void ShouldNotEnumerateButReturnZero_WhenCollectionIsEmpty() { // Arrange var collection = new CheckingCollection <string>(new string[0]); var smartList = new SmartList <string>(collection); // Act var count = smartList.Count; // Assert Assert.Equal(0, count); Assert.False(collection.Enumerated); }