Updated JsonPatchExtensionsTest exception message (Reacting to JsonPatch repo commit: 393c25988a)
This commit is contained in:
parent
45337c1fc2
commit
80da4611d9
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
public void ApplyTo_JsonPatchDocument_ModelState()
|
public void ApplyTo_JsonPatchDocument_ModelState()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var operation = new Operation<Customer>("add", "Customer/CustomerId", from: null, value: "TestName");
|
var operation = new Operation<Customer>("add", "CustomerId", from: null, value: "TestName");
|
||||||
var patchDoc = new JsonPatchDocument<Customer>();
|
var patchDoc = new JsonPatchDocument<Customer>();
|
||||||
patchDoc.Operations.Add(operation);
|
patchDoc.Operations.Add(operation);
|
||||||
|
|
||||||
|
|
@ -25,14 +25,14 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
var error = Assert.Single(modelState["Customer"].Errors);
|
var error = Assert.Single(modelState["Customer"].Errors);
|
||||||
Assert.Equal("The property at path 'Customer/CustomerId' could not be added.", error.ErrorMessage);
|
Assert.Equal("The target location specified by path segment 'CustomerId' was not found.", error.ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void ApplyTo_JsonPatchDocument_PrefixModelState()
|
public void ApplyTo_JsonPatchDocument_PrefixModelState()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var operation = new Operation<Customer>("add", "Customer/CustomerId", from: null, value: "TestName");
|
var operation = new Operation<Customer>("add", "CustomerId", from: null, value: "TestName");
|
||||||
var patchDoc = new JsonPatchDocument<Customer>();
|
var patchDoc = new JsonPatchDocument<Customer>();
|
||||||
patchDoc.Operations.Add(operation);
|
patchDoc.Operations.Add(operation);
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Microsoft.AspNetCore.Mvc
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
var error = Assert.Single(modelState["jsonpatch.Customer"].Errors);
|
var error = Assert.Single(modelState["jsonpatch.Customer"].Errors);
|
||||||
Assert.Equal("The property at path 'Customer/CustomerId' could not be added.", error.ErrorMessage);
|
Assert.Equal("The target location specified by path segment 'CustomerId' was not found.", error.ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Customer
|
public class Customer
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue