public void TestDomReadOnlyErrorCreate(string name, Error[] expectedErrors) { // Arrange // Act var actual = DomReadOnlyErrors.Create(expectedErrors); this.Output.WriteLine("Test Name: {0}", name); this.Output.WriteLine(String.Empty); this.OutputDomTree(actual); // Assert DomReadOnlyErrorsAssert.Equal(expectedErrors, actual); }
private void CompactDomErrors() { var domErrors = (IDomErrors)this.DomDocument.GetNode(DomNodeType.Errors); if (domErrors == null || domErrors.IsReadOnly) { return; } var domReadWriteErrors = (DomReadWriteErrors)domErrors; var domParentNode = (IContainerNode <DomNodeType>)domReadWriteErrors.ParentNode; var apiErrors = domErrors.Errors; var domReadOnlyErrors = DomReadOnlyErrors.Create(apiErrors); domParentNode.ReplaceNode(domReadWriteErrors, domReadOnlyErrors); }