public void GetEnumerator_CollectionWithMultipleElements_ReturnsCollectionWithAllTheElementsThatHasTheSameLengthAsTheLongestElement() { var collection = new List <string> { "A", "BBBB", "CCC", "DDDD", "EEE", "FFFF", "GG", "H", "IIII", "J" }; var output = new AllWithMinEnumerable <string, int>(collection, s => s?.Length ?? 0).ToList(); CollectionAssert.AreEqual(new[] { "A", "H", "J", }, output); }
public void GetEnumerator_EmptyCollection_ReturnsEmptyResult() { var collection = new List <string>(); var output = new AllWithMinEnumerable <string, int>(collection, s => s?.Length ?? 0).ToList(); Assert.That(output, Is.Empty); }
public void GetEnumerator_CollectionWithOneElement_ReturnsCollectionWithThatElement() { var collection = new List <string> { "AAA" }; var output = new AllWithMinEnumerable <string, int>(collection, s => s?.Length ?? 0).ToList(); CollectionAssert.AreEqual(collection, output); }
public void GetEnumerator_CollectionWithTwoElementsOfDifferentLengths_ReturnsCollectionWithTheLongestElement() { var collection = new List <string> { "AAA", "BBBB", }; var output = new AllWithMinEnumerable <string, int>(collection, s => s?.Length ?? 0).ToList(); CollectionAssert.AreEqual(new[] { "AAA" }, output); }