Exemple #1
0
        public void When_FindAllIndex()
        {
            string     source   = "abcdefgabcdefg";
            List <int> expected = new List <int> {
                0, 5, 7, 12
            };
            List <int> actual;

            actual = CollectionExtensions.FindAllIndex(source, i => i == 'a' || i == 'f');

            CollectionAssert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void When_FindAllIndex1()
        {
            List <string> source = new List <string> {
                "abc", "def", "ghi", "abcde"
            };
            List <int> expected = new List <int> {
                0, 3
            };
            List <int> actual;

            actual = CollectionExtensions.FindAllIndex(source, i => i.Contains("a"));

            CollectionAssert.AreEqual(expected, actual);
        }