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

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

            Assert.Equal(pattern.GetMatches(matchTarget).Count(), 3);
        }
Ejemplo 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);
        }
Ejemplo n.º 4
0
        public void GetMatches_ReturnsOneMatchLocation_WhenIdenticalStringIsMatchedAgainst()
        {
            TextPattern pattern = new TextPattern(dummyString);

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

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