// PUBLIC METHODS /////////////////////////////////////////////////// #region Assert Methods public static void Equal(IEnumerable <Error> expected, DomReadWriteErrors actual) { if (expected == null) { Assert.Null(actual); return; } Assert.NotNull(actual); Assert.Equal(DomNodeType.Errors, actual.NodeType); var expectedCollection = expected.SafeToReadOnlyList(); var actualNodes = actual.Nodes() .ToList(); var actualDomErrorsCount = actualNodes.Count; Assert.Equal(expectedCollection.Count, actualDomErrorsCount); var count = expectedCollection.Count; for (var i = 0; i < count; ++i) { var expectedError = expectedCollection[i]; var actualNode = actualNodes[i]; var actualDomError = (IDomError)actualNode; var actualError = actualDomError.Error; ErrorAssert.Equal(expectedError, actualError); } }
internal void TestDomReadWriteErrorCreate(string name, Error[] expected, DomReadWriteErrors actual) { // Arrange // Act this.Output.WriteLine("Test Name: {0}", name); this.Output.WriteLine(String.Empty); this.OutputDomTree(actual); // Assert DomReadWriteErrorsAssert.Equal(expected, actual); }