Skip to content

Commit

Permalink
This one works
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Jan 21, 2021
1 parent ef6ca99 commit 6a26469
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Manatee.Json.Tests/XmlExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,19 @@ public void RoundTrip_StartingWithHorribleMultiRepeatingXml()

Assert.AreEqual(expected.ToString(), actual.ToString());
}
[Test]
public void RoundTrip_StartingWithNestingXml()
{
var expected = XElement.Parse(@"<Items><Item><Item uid=""x""/></Item><Item ><Item uid=""y""/></Item><Item><Item uid=""z""/></Item></Items>");
var expectedJson = JsonValue.Parse(@"{""Items"":{""Item"":[{""Item"":[{""-uid"":""x""},null]},{""Item"":[{""-uid"":""y""},null]},{""Item"":[{""-uid"":""z""},null]}]}}");

var toJson = expected.ToJson();
Assert.AreEqual(expectedJson, toJson);

var actual = toJson.ToXElement(null);

Assert.AreEqual(expected.ToString(), actual.ToString());
}
#endregion
}
}

0 comments on commit 6a26469

Please sign in to comment.