public void NonMatching(string input, string pattern)
        {
            var router = new Router <int>(new MatchingRoutesSelectionStrategy <int>());

            router.Register("", RouterPatternParser.Parse(pattern), 1);

            var result = router.Match(CreateMessage(input));

            Assert.Empty(result);
        }
Example #2
0
        public void Run(string left, string right, int expected)
        {
            var comparer = new RouteScoreComparer();

            var result = comparer.Compare(
                RouterPatternParser.Parse(left),
                RouterPatternParser.Parse(right)
                );

            Assert.Equal(expected, result);
        }
Example #3
0
 public MessageRouteAttribute(string route)
     : this(RouterPatternParser.Parse(route))
 {
 }