예제 #1
0
        public void CompareTo_Returns0_ForEquivalentRoutes()
        {
            HttpRouteEntry x = CreateRouteEntry("Employees/{id}");
            HttpRouteEntry y = CreateRouteEntry("Employees/{id}");

            Assert.Equal(0, x.CompareTo(y));
        }
예제 #2
0
        public void CompareTo_ComparesCorrectly(string earlier, string later)
        {
            HttpRouteEntry x = CreateRouteEntry(earlier);
            HttpRouteEntry y = CreateRouteEntry(later);

            Assert.True(x.CompareTo(y) < 0);
            Assert.True(y.CompareTo(x) > 0);
        }
예제 #3
0
        public void CompareTo_RespectsOrder(int prefixOrder1, int prefixOrder2, int order1, int order2, int expectedValue)
        {
            HttpRouteEntry x = new HttpRouteEntry()
            {
                PrefixOrder = prefixOrder1, Order = order1
            };
            HttpRouteEntry y = new HttpRouteEntry()
            {
                PrefixOrder = prefixOrder2, Order = order2
            };

            Assert.Equal(expectedValue, x.CompareTo(y));
        }