public void FallsBackToStringComparison_WhenPassedInvalidXmlValues() { var comparison = new XmlComparison(); RunComparer(comparison, "NOT XML", "NOT XML", true); RunComparer(comparison, "NOT XML", "ALSO NOT XML", false); }
protected override void Append(StringBuilder builder, XmlComparison difference) { builder.Append(" ").Append(difference.ComparisonType).Append(":"); if (difference.ExpectedDetails != null) { builder.AppendLine(); builder.Append(" Expected: "); this.Append(builder, difference.ExpectedDetails); } if (difference.ActualDetails != null) { builder.AppendLine(); builder.Append(" Actual: "); this.Append(builder, difference.ActualDetails); } }
public void XmlComparison_CanCompare_XmlFieldTypes(string fieldType, bool expected) { var comparison = new XmlComparison(); comparison.CanCompare(new FakeFieldValue("foo", fieldType), new FakeFieldValue("foo", fieldType)).Should().Be(expected); }
public void ReturnsFalse_WhenUnequalStrings(string val1, string val2) { var comparison = new XmlComparison(); RunComparer(comparison, val1, val2, false); }
public void ReturnsTrue_WhenEqualStrings(string val1, string val2) { var comparison = new XmlComparison(); RunComparer(comparison, val1, val2, true); }
public void Throws_WhenPassedInvalidXmlValues() { var comparison = new XmlComparison(); Assert.Throws <InvalidOperationException>(() => RunComparer(comparison, "NOT XML", "NOT XML", false)); }