Esempio n. 1
0
        public void GetMatches_ReturnsThreeMatchLocations_When666IsMatchedAgainst()
        {
            string      matchTarget = "666";
            TextPattern pattern     = new TextPattern(dummyRegexPattern);

            Assert.Equal(pattern.GetMatches(matchTarget).Count(), 3);
        }
        public void GetMatches_ReturnsThreeMatchLocations_When666IsMatchedAgainst()
        {
            string matchTarget = "666";
            TextPattern pattern = new TextPattern(dummyRegexPattern);

            Assert.Equal(pattern.GetMatches(matchTarget).Count(), 3);
        }
Esempio n. 3
0
        public void GetMatches_ReturnsExpectedMatches_When012IsMatchedAgainst()
        {
            string        matchTarget = "012";
            TextPattern   pattern     = new TextPattern(dummyRegexPattern);
            List <string> matches     = pattern.GetMatches(matchTarget).ToList();

            bool allMatch = true;

            for (int i = 0; i < matches.Count; i++)
            {
                if (i != int.Parse(matches[i]))
                {
                    allMatch = false;
                }
            }

            Assert.True(allMatch);
        }
Esempio n. 4
0
        public void GetMatches_ReturnsOneMatchLocation_WhenIdenticalStringIsMatchedAgainst()
        {
            TextPattern pattern = new TextPattern(dummyString);

            Assert.Equal(pattern.GetMatches(dummyString).Count(), 1);
        }
        public void GetMatches_ReturnsOneMatchLocation_WhenIdenticalStringIsMatchedAgainst()
        {
            TextPattern pattern = new TextPattern(dummyString);

            Assert.Equal(pattern.GetMatches(dummyString).Count(), 1);
        }