예제 #1
0
        public void Match_MissingValue_IsNotFileName()
        {
            // Arrange
            var constraint = new FileNameRouteConstraint();

            var values = new RouteValueDictionary();

            // Act
            var result = constraint.Match(httpContext: null, route: null, "path", values, RouteDirection.IncomingRequest);

            // Assert
            Assert.False(result);
        }
예제 #2
0
        public void Match_RouteValue_IsFileName(object value)
        {
            // Arrange
            var constraint = new FileNameRouteConstraint();

            var values = new RouteValueDictionary();

            values.Add("path", value);

            // Act
            var result = constraint.Match(httpContext: null, route: null, "path", values, RouteDirection.IncomingRequest);

            // Assert
            Assert.True(result);
        }