blob: 99977ee7530bc3050c66a66c866eb7d6cca77d1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// 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.
using Microsoft.AspNetCore.Routing.Constraints;
using Xunit;
namespace Microsoft.AspNetCore.Routing.Tests
{
public class LongRouteConstraintTests
{
[Theory]
[InlineData(42, true)]
[InlineData(42L, true)]
[InlineData("42", true)]
[InlineData("9223372036854775807", true)]
[InlineData(3.14, false)]
[InlineData("43.567", false)]
[InlineData("42a", false)]
public void LongRouteConstraintTest(object parameterValue, bool expected)
{
// Arrange
var constraint = new LongRouteConstraint();
// Act
var actual = ConstraintsTestHelper.TestConstraint(constraint, parameterValue);
// Assert
Assert.Equal(expected, actual);
}
}
}
|