Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }