コード例 #1
0
        public void TestMatches()
        {
            using (var routeMatcher = new RouteMatcher())
            {
                object actual      = string.Empty;
                string expected    = "zh-CN";
                var    template    = "api/Locale/Get/{locale}";
                var    routeValues = routeMatcher.Matches(template, $"/api/Locale/Get/{expected}");
                routeValues.TryGetValue("locale", out actual);

                Assert.AreEqual(expected, actual);
            }
        }