public void MaxLengthRouteConstraintTests(int min, string parameterValue, bool expected) { var constraint = new MaxLengthRouteConstraint(min); var actual = TestValue(constraint, parameterValue); Assert.Equal(expected, actual); }
private static void ApplyMaxLengthRouteConstraint(OpenApiSchema schema, MaxLengthRouteConstraint maxLengthRouteConstraint) { if (schema.Type == "array") { schema.MaxItems = maxLengthRouteConstraint.MaxLength; } else { schema.MaxLength = maxLengthRouteConstraint.MaxLength; } }
public void MaxLengthRouteConstraint_ApplyConstraint(int min, string parameterValue, bool expected) { // Arrange var constraint = new MaxLengthRouteConstraint(min); // Act var actual = ConstraintsTestHelper.TestConstraint(constraint, parameterValue); // Assert Assert.Equal(expected, actual); }