public void ReplaceNestedObject()
        {
            var doc = new SimpleDTOWithNestedDTO()
            {
                IntegerValue = 1

            };

            var newNested = new NestedDTO() { StringProperty = "B" };

            // create patch
            JsonPatchDocument<SimpleDTOWithNestedDTO> patchDoc = new JsonPatchDocument<SimpleDTOWithNestedDTO>();
            patchDoc.Replace<NestedDTO>(o => o.NestedDTO, newNested);

            patchDoc.ApplyTo(doc);

            Assert.Equal("B", doc.NestedDTO.StringProperty);

        }
        public void ReplaceNestedObjectWithSerialization()
        {
            var doc = new SimpleDTOWithNestedDTO()
            {
                IntegerValue = 1

            };

            var newNested = new NestedDTO() { StringProperty = "B" };

            // create patch
            JsonPatchDocument<SimpleDTOWithNestedDTO> patchDoc = new JsonPatchDocument<SimpleDTOWithNestedDTO>();
            patchDoc.Replace<NestedDTO>(o => o.NestedDTO, newNested);

            var serialized = JsonConvert.SerializeObject(patchDoc);
            var deserialized = JsonConvert.DeserializeObject<JsonPatchDocument<SimpleDTOWithNestedDTO>>(serialized);



            deserialized.ApplyTo(doc);

            Assert.Equal("B", doc.NestedDTO.StringProperty);

        }