public void ReplaceGivenPropertyWithNoAttributesSetsCorrectPatchOperation() { //Arrange IPatchOperationBuilder <Item1> builder = new PatchOperationBuilder <Item1>(); //Act builder.Replace(x => x.TestIntProperty, 50); //Assert PatchOperation operation = builder.PatchOperations.First(); Assert.Equal(PatchOperationType.Replace, operation.OperationType); Assert.Equal("/testIntProperty", operation.Path); }
public void ReplaceGivenPropertyWithRequiredAndJsonAttributesSetsCorrectPatchOperation() { //Arrange IPatchOperationBuilder <RequiredAndJsonItem> builder = new PatchOperationBuilder <RequiredAndJsonItem>(); //Act builder.Replace(x => x.TestProperty, "Test Value"); //Assert PatchOperation operation = builder.PatchOperations.First(); Assert.Equal(PatchOperationType.Replace, operation.OperationType); Assert.Equal("/testProperty", operation.Path); }
public void ReplaceGivenPropertyValueWithJsonAttributeSetsCorrectReplaceValue() { //Arrange IPatchOperationBuilder <Item1> builder = new PatchOperationBuilder <Item1>(); //Act builder.Replace(x => x.TestProperty, "100"); //Assert PatchOperation operation = builder.PatchOperations.First(); Assert.Equal(PatchOperationType.Replace, operation.OperationType); Assert.Equal("/thisIsTheName", operation.Path); }