Skip to content

Commit

Permalink
Nested object support
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinDockx committed Dec 17, 2014
1 parent d537373 commit 475d6ee
Show file tree
Hide file tree
Showing 11 changed files with 1,280 additions and 370 deletions.
22 changes: 11 additions & 11 deletions src/Marvin.JsonPatch.Test/ExpandoObjectAdapterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ namespace Marvin.JsonPatch.Test
public class ExpandoObjectAdapterTests
{

[TestMethod]
public void Remove()
{
dynamic doc = new ExpandoObject();
doc.StringProperty = "A";
//[TestMethod]
//public void Remove()
//{
// dynamic doc = new ExpandoObject();
// doc.StringProperty = "A";

// create patch
JsonPatchDocument patchDoc = new JsonPatchDocument();
patchDoc.Remove("StringProperty");
// // create patch
// JsonPatchDocument patchDoc = new JsonPatchDocument();
// patchDoc.Remove("StringProperty");

patchDoc.ApplyTo(doc, new ExpandoObjectAdapter());
// patchDoc.ApplyTo(doc, new ExpandoObjectAdapter());

Assert.AreEqual(null, doc.StringProperty);
// Assert.AreEqual(null, doc.StringProperty);

}
//}

}
}
3 changes: 3 additions & 0 deletions src/Marvin.JsonPatch.Test/Marvin.JsonPatch.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@
</Choose>
<ItemGroup>
<Compile Include="ExpandoObjectAdapterTests.cs" />
<Compile Include="NestedDTO.cs" />
<Compile Include="NestedObjectTests.cs" />
<Compile Include="OperationTests.cs" />
<Compile Include="SimpleDTO.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SimpleDTOWithNestedDTO.cs" />
<Compile Include="SimpleObjectAdapterTests.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
13 changes: 13 additions & 0 deletions src/Marvin.JsonPatch.Test/NestedDTO.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Marvin.JsonPatch.Test
{
public class NestedDTO
{
public string StringProperty { get; set; }
}
}

0 comments on commit 475d6ee

Please sign in to comment.