コード例 #1
0
        public void GetCorrectStringInfoFromList()
        {
            List <StringInfo> expectedResult = new List <StringInfo>
            {
                new StringInfo('o', 3),
                new StringInfo('c', 11),
                new StringInfo('d', 3),
                new StringInfo('m', 6),
                new StringInfo('p', 5),
                new StringInfo('s', 6),
            };
            var result = LinqMethods.GetStringInfo(_randomStrings);

            Assert.AreEqual(expectedResult.Count, result.Count);
            for (var i = 0; i < expectedResult.Count; i++)
            {
                Assert.AreEqual(expectedResult[i].FirstChar, result[i].FirstChar);
                Assert.AreEqual(expectedResult[i].Length, result[i].Length);
            }
        }