public void TestDDNodeJsonManualFormatSingleAttributteGUIDArray() { var n = new DDNode("NodeName", "NodeType"); n.Attributes.Add("a", new DDValue(new [] { new Guid("faf77826-1f05-42d2-880f-ca19fa1bc60e"), new Guid("faf77826-1f05-42d2-880f-ca19fa1bc70e")})); string j = "{\"NodeName\":{\"ac\": [{\"a\": {\"v\":[\"faf77826-1f05-42d2-880f-ca19fa1bc60e\",\"faf77826-1f05-42d2-880f-ca19fa1bc70e\"],\"t\": \"System.Guid[]\"}}], \"t\":\"NodeType\"}}"; var result = DDNodeSje.Deserialize(j); ValidateDeserialization(n, result); }
public void TestDDNodeJsonDirectSerialization() { var n = new DDNode("name", "type"); n.Attributes.Add("bool", false); n.Attributes.Add("int", -1); n.Add("ChildNode").Add("SubChildNode").Attributes.Add("string", "string"); StringBuilder sb = new StringBuilder(); n.Serialize(sb); var d = DDNodeSje.Deserialize(sb.ToString()); ValidateDeserialization(n, d); }