Goal : Write More efficient unit tests for the converters

Current situation

Actually the basic unit test are working as following :

This is not the best solution, because string can be different, even if the result is fine (just a change in the order or the attribute can broke the test).

General Solution

Instead of comparing strings, we should compare XML, not strings.

So the algorithm will be following

To avoid to rewrite all the test, and to let the programmer write easy string for the tests, the best will be to also convert the expected string in to XML object, instead of directly write the XML object.

Another approach would e to give just the list of expected node in the resulting XML object.

Possible technical solution

Check the different algorithm to compare two XML files.

MoinMoin: DOM DocBook and HTML 2010/NewUnitTest (last edited 2010-05-18 09:51:00 by ValentinJaniaut)