public void ApplyUpdate_MoveOperation_EntityUpdated() { //Arrange var patchDocument = new JsonPatchDocument<SimpleEntity>(); var entity = new SimpleEntity { Foo = "bar", Baz = "qux" }; //Act patchDocument.Move("Foo", "Baz"); patchDocument.ApplyUpdatesTo(entity); //Assert Assert.IsNull(entity.Foo); Assert.AreEqual("bar", entity.Baz); }
public void ApplyUpdate_ReplaceOperation_EntityUpdated() { //Arrange var patchDocument = new JsonPatchDocument<SimpleEntity>(); var entity = new SimpleEntity { Foo = "bar" }; //Act patchDocument.Replace("Foo", "baz"); patchDocument.ApplyUpdatesTo(entity); //Assert Assert.AreEqual("baz", entity.Foo); }