Exemplo n.º 1
0
        public static void AssertMatches <T, TGenerex, TGenerexMatch>(GenerexNoResultBase <T, TGenerex, TGenerexMatch> generex, T[] input, Expectation isMatch, Expectation isMatchAt1, Expectation isMatchUpTo1, Expectation isMatchExact, Expectation isMatchReverse, object[] match, object[] matchExact, object[] matchReverse, int matches, int matchesReverse)
            where TGenerex : GenerexNoResultBase <T, TGenerex, TGenerexMatch>
            where TGenerexMatch : GenerexMatch <T>
        {
            assertMatchesBase(generex, input, isMatch, isMatchAt1, isMatchUpTo1, isMatchExact, isMatchReverse, match, matchExact, matchReverse, matches, matchesReverse);

            // Test 1: generex.Method(input)
            assertMatch <T, TGenerexMatch>(match, () => generex.Match(input));
            assertMatch <T, TGenerexMatch>(matchExact, () => generex.MatchExact(input));
            assertMatch <T, TGenerexMatch>(matchReverse, () => generex.MatchReverse(input));

            // Test 2: input.Method(generex)
            assertMatch <T, TGenerexMatch>(match, () => input.Match(generex));
            assertMatch <T, TGenerexMatch>(matchExact, () => input.MatchExact(generex));
            assertMatch <T, TGenerexMatch>(matchReverse, () => input.MatchReverse(generex));
        }
Exemplo n.º 2
0
 public static void AssertMatches <TGenerex, TGenerexMatch>(GenerexNoResultBase <char, TGenerex, TGenerexMatch> generex, string input, Expectation isMatch, Expectation isMatchAt1, Expectation isMatchUpTo1, Expectation isMatchExact, Expectation isMatchReverse, object[] match, object[] matchExact, object[] matchReverse, int matches, int matchesReverse)
     where TGenerex : GenerexNoResultBase <char, TGenerex, TGenerexMatch>
     where TGenerexMatch : GenerexMatch <char>
 {
     AssertMatches(generex, input.ToCharArray(), isMatch, isMatchAt1, isMatchUpTo1, isMatchExact, isMatchReverse, match, matchExact, matchReverse, matches, matchesReverse);
 }