public XmlNodeSimplified Build(XmlNode node) { var result = new XmlNodeSimplified { Name = node.Name, Attributes = GetAttributes(node).ToArray(), Children = node.ChildNodes.Cast <XmlNode>().Select(Build).ToArray(), NodeType = node.NodeType, InnerText = node.InnerText }; return(result); }
public void BeEqualTo(XmlNodeSimplified expected) { BeEqualShallowTo(expected); _childrenNumberCheck.AssertChildrenNumber(expected); var childrenActual = _assertContext.XmlNode.Children.ToList(); var childrenExpected = expected.Children.ToList(); for (var i = 0; i < childrenActual.Count; i++) { var childAssertable = CreateChildAssertable(childrenActual, i); childAssertable.BeEqualTo(childrenExpected[i]); } }
public AssertContext BuildChildContext(XmlNodeSimplified childNode, int childNodeIndex) { var childPath = MyPath.Append(childNode.Name, childNodeIndex); return(new AssertContext(childPath, childNode, StringComparer)); }
public AssertContext(XmlPath myPath, XmlNodeSimplified xmlNode, StringComparer stringComparer) { MyPath = myPath; XmlNode = xmlNode; StringComparer = stringComparer; }
public AssertContext Build(XmlPath path, XmlNodeSimplified node) { return(new AssertContext(path, node, _stringComparer)); }
private void BeEqualShallowTo(XmlNodeSimplified expected) { _nameCheck.AssertName(expected.Name); _attributeCheck.AssertAttributesCollection(expected.Attributes); _textCheck.AssertText(expected); }