public void MinLengthRouteConstraint_ApplyConstraint(int min, string parameterValue, bool expected)
        {
            // Arrange
            var constraint = new MinLengthRouteConstraint(min);

            // Act
            var actual = ConstraintsTestHelper.TestConstraint(constraint, parameterValue);

            // Assert
            Assert.Equal(expected, actual);
        }
        public void AddResolvedConstraint_And_AddConstraint_ForOptionalParameter()
        {
            var builder = CreateBuilder("{controller}/{action}/{name}");
            builder.SetOptional("name");
            builder.AddResolvedConstraint("name", "alpha");
            var minLenConstraint = new MinLengthRouteConstraint(10);
            builder.AddConstraint("name", minLenConstraint);

            var result = builder.Build();
            Assert.Equal(1, result.Count);
            Assert.Equal("name", result.First().Key);
            Assert.IsType<OptionalRouteConstraint>(Assert.Single(result).Value);
            var optionalConstraint = (OptionalRouteConstraint)result.First().Value;
            var compositeConstraint = Assert.IsType<CompositeRouteConstraint>(optionalConstraint.InnerConstraint); ;
            Assert.Equal(compositeConstraint.Constraints.Count(), 2);

            Assert.Single(compositeConstraint.Constraints, c => c is MinLengthRouteConstraint);
            Assert.Single(compositeConstraint.Constraints, c => c is AlphaRouteConstraint);
        }