Esempio n. 1
0
        public void StringToListFromStringPatternTest()
        {
            var pattern = ",";

            var list = Splitter.OnPattern(pattern).SplitToList(OriginalStrings.NormalString);

            list.Count().ShouldBe(5);

            list[0].ShouldBe("a");
            list[1].ShouldBe("b");
            list[2].ShouldBe("c");
            list[3].ShouldBe("d");
            list[4].ShouldBe("e");
        }
Esempio n. 2
0
        public void StringToEnumerableFromStringPatternTest()
        {
            var pattern = ",";

            var enumerable = Splitter.OnPattern(pattern).Split(OriginalStrings.NormalString);

            // ReSharper disable once PossibleMultipleEnumeration
            enumerable.Count().ShouldBe(5);

            // ReSharper disable once PossibleMultipleEnumeration
            var list = enumerable.ToList();

            list[0].ShouldBe("a");
            list[1].ShouldBe("b");
            list[2].ShouldBe("c");
            list[3].ShouldBe("d");
            list[4].ShouldBe("e");
        }