Enabling test for 2447, CancellationToken does not gets validated.
This commit is contained in:
parent
e31eab0391
commit
386562c269
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNet.Mvc.IntegrationTests
|
||||||
public byte[] Token { get; set; }
|
public byte[] Token { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Theory(Skip = "ModelState.Value not set due to #2445, #2447")]
|
[Theory(Skip = "ModelState.Value not set due to #2445")]
|
||||||
[InlineData(true)]
|
[InlineData(true)]
|
||||||
[InlineData(false)]
|
[InlineData(false)]
|
||||||
public async Task BindProperty_WithData_GetsBound(bool fallBackScenario)
|
public async Task BindProperty_WithData_GetsBound(bool fallBackScenario)
|
||||||
|
|
@ -68,12 +68,12 @@ namespace Microsoft.AspNet.Mvc.IntegrationTests
|
||||||
var key = Assert.Single(modelState.Keys, k => k == queryStringKey + "[0]");
|
var key = Assert.Single(modelState.Keys, k => k == queryStringKey + "[0]");
|
||||||
Assert.NotNull(modelState[key].Value); // should be non null bug #2445.
|
Assert.NotNull(modelState[key].Value); // should be non null bug #2445.
|
||||||
Assert.Empty(modelState[key].Errors);
|
Assert.Empty(modelState[key].Errors);
|
||||||
Assert.Equal(ModelValidationState.Valid, modelState[key].ValidationState); // Should be skipped. bug#2447
|
Assert.Equal(ModelValidationState.Valid, modelState[key].ValidationState);
|
||||||
|
|
||||||
key = Assert.Single(modelState.Keys, k => k == queryStringKey + "[1]");
|
key = Assert.Single(modelState.Keys, k => k == queryStringKey + "[1]");
|
||||||
Assert.NotNull(modelState[key].Value); // should be non null bug #2445.
|
Assert.NotNull(modelState[key].Value); // should be non null bug #2445.
|
||||||
Assert.Empty(modelState[key].Errors);
|
Assert.Empty(modelState[key].Errors);
|
||||||
Assert.Equal(ModelValidationState.Valid, modelState[key].ValidationState); // Should be skipped. bug#2447
|
Assert.Equal(ModelValidationState.Valid, modelState[key].ValidationState);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ namespace Microsoft.AspNet.Mvc.IntegrationTests
|
||||||
public CancellationToken Token { get; set; }
|
public CancellationToken Token { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(Skip = "CancellationToken should not be validated #2447.")]
|
[Fact]
|
||||||
public async Task BindProperty_WithData__WithPrefix_GetsBound()
|
public async Task BindProperty_WithData_WithPrefix_GetsBound()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var argumentBinder = ModelBindingTestHelper.GetArgumentBinder();
|
var argumentBinder = ModelBindingTestHelper.GetArgumentBinder();
|
||||||
|
|
@ -55,19 +55,11 @@ namespace Microsoft.AspNet.Mvc.IntegrationTests
|
||||||
// ModelState
|
// ModelState
|
||||||
Assert.True(modelState.IsValid);
|
Assert.True(modelState.IsValid);
|
||||||
|
|
||||||
Assert.Equal(2, modelState.Keys.Count);
|
Assert.Equal(0, modelState.Keys.Count);
|
||||||
Assert.Single(modelState.Keys, k => k == "CustomParameter");
|
|
||||||
|
|
||||||
var key = Assert.Single(modelState.Keys, k => k == "CustomParameter.Token");
|
|
||||||
Assert.Null(modelState[key].Value);
|
|
||||||
Assert.Empty(modelState[key].Errors);
|
|
||||||
|
|
||||||
// This Assert Fails.
|
|
||||||
Assert.Equal(ModelValidationState.Skipped, modelState[key].ValidationState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(Skip = "CancellationToken should not be validated #2447")]
|
[Fact]
|
||||||
public async Task BindProperty_WithData__WithEmptyPrefix_GetsBound()
|
public async Task BindProperty_WithData_WithEmptyPrefix_GetsBound()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var argumentBinder = ModelBindingTestHelper.GetArgumentBinder();
|
var argumentBinder = ModelBindingTestHelper.GetArgumentBinder();
|
||||||
|
|
@ -97,16 +89,10 @@ namespace Microsoft.AspNet.Mvc.IntegrationTests
|
||||||
|
|
||||||
// ModelState
|
// ModelState
|
||||||
Assert.True(modelState.IsValid);
|
Assert.True(modelState.IsValid);
|
||||||
var key = Assert.Single(modelState.Keys);
|
Assert.Equal(0, modelState.Count);
|
||||||
Assert.Equal("Token", key);
|
|
||||||
Assert.Null(modelState[key].Value);
|
|
||||||
Assert.Empty(modelState[key].Errors);
|
|
||||||
|
|
||||||
// This Assert Fails.
|
|
||||||
Assert.Equal(ModelValidationState.Skipped, modelState[key].ValidationState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact(Skip = "CancellationToken should not be validated #2447.")]
|
[Fact]
|
||||||
public async Task BindParameter_WithData_GetsBound()
|
public async Task BindParameter_WithData_GetsBound()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
@ -140,13 +126,7 @@ namespace Microsoft.AspNet.Mvc.IntegrationTests
|
||||||
|
|
||||||
// ModelState
|
// ModelState
|
||||||
Assert.True(modelState.IsValid);
|
Assert.True(modelState.IsValid);
|
||||||
var key = Assert.Single(modelState.Keys);
|
Assert.Equal(0, modelState.Count);
|
||||||
Assert.Equal("CustomParameter", key);
|
|
||||||
Assert.Null(modelState[key].Value);
|
|
||||||
Assert.Empty(modelState[key].Errors);
|
|
||||||
|
|
||||||
// This assert fails.
|
|
||||||
Assert.Equal(ModelValidationState.Skipped, modelState[key].ValidationState);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue