aspnetcore/test/Microsoft.AspNet.Routing.Tests/Constraints/MaxRouteConstraintTests.cs

32 lines
840 B
C#

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#if DNX451
using Microsoft.AspNet.Routing.Constraints;
using Xunit;
namespace Microsoft.AspNet.Routing.Tests
{
public class MaxRouteConstraintTests
{
[Theory]
[InlineData(3, 2, true)]
[InlineData(3, 3, true)]
[InlineData(3, 4, false)]
public void MaxRouteConstraint_ApplyConstraint(long max, int parameterValue, bool expected)
{
// Arrange
var constraint = new MaxRouteConstraint(max);
// Act
var actual = ConstraintsTestHelper.TestConstraint(constraint, parameterValue);
// Assert
Assert.Equal(expected, actual);
}
}
}
#endif