public void Patch_Returns_Expected_Result(JsonMergePatchTestCase <SimpleClass> testcase)
        {
            var patcher = BuildPatchDocument <SimpleClass>(testcase.Patch);

            patcher.ApplyPatch(testcase.Original);
            Assert.AreEqual(testcase.ExpectedResult, testcase.Original);
        }
        public void ApplyPatch_Returns_Expected_Result(JsonMergePatchTestCase <SimpleArrayClass> testcase)
        {
            var patcher = BuildPatchDocument <SimpleArrayClass>(testcase.Patch);

            patcher.ApplyPatch(testcase.Original);
            if (testcase.ExpectedResult == null)
            {
                Assert.IsNull(testcase.Original);
            }
            else
            {
                Assert.IsNotNull(testcase.Original);
                CollectionAssert.AreEquivalent(testcase.ExpectedResult.A, testcase.Original.A);
            }
        }