public void GetNodesNumberTest() { INodeBilder node = new NodeBilder(); node.AddNode("node1", "type1").AddProperty("prop1", "proptext1"); node.AddNode("node2", "type2").AddProperty("prop2", "proptext2"); node.AddProperty("prop3", "proptext3"); int nodeNumber = node.GetNodesNumber(); Assert.IsTrue(nodeNumber == 2); }
public void AddPropertyTest() { INodeBilder node = new NodeBilder(); node.AddProperty("1PropertyName", "1PropertyText"); Node assertNode = (NodeBilder)node; PropertyNode prop = assertNode.Nodes[0] as PropertyNode; Assert.IsNotNull(prop); StringAssert.Contains(prop.Name, "1PropertyName"); StringAssert.Contains(prop.Text, "1PropertyText"); StringAssert.Contains(prop.Type, "string"); StringAssert.Contains(prop.tagName, "property"); }