我使用 XUnit。对我来说这是两个相同的 XML,但是测试失败了。如何使用 Xunit 比较它们?或者是其他东西?
public void testIdentical() throws Exception {
String myControlXML = "<struct>" +
"<int a=\"1\"></int>" +
"<int a=\"2\"></int>" +
"</struct>";
String myTestXML = "<struct>" +
"<int a=\"2\"></int>" +
"<int a=\"1\"></int>" +
"</struct>";
Diff myDiff = new Diff(myControlXML, myTestXML);
assertTrue("my test" + myDiff, myDiff.similar());
}
java.lang.AssertionError: my test org.custommonkey.xmlunit.Diff
[different] Expected attribute value '1' but was '2' - comparing <int a="1"...> at /struct[1]/int[1]/@a to <int a="2"...> at /struct[1]/int[1]/@a