How To Use
|
Overview
In the simplest case you are always working with the singleton instance of XmlCheck.
A proper initialization can be done within global fixture of your test. There you decide which attributes and nodes shall be skipped throughout your test cases:
struct MyGlobalFixture : public TTB::DefaultSettingsForBoostAndTTB { MyGlobalFixture(void) { TTB::TheXmlCheck()->IgnoreAttribute("date"); TTB::TheXmlCheck()->IgnoreAttribute("time"); ... } } BOOST_GLOBAL_FIXTURE(MyGlobalFixture);
In every test case you are using the same singleton instance of XmlCheck and you have not to care about proper initialization:
TheXmlCheck()->CheckNode(someXmlNode);
It may be necessary for some test cases to perform XML checks with changed filter settings. Then it is possible to
To make it even more simple you can use the automatic object AutoRestoreXmlCheck for storing and restoring settings:
An other simple alternative for ensuring proper settings for XmlCheeck would be to initialize XmlCheck with desired settings within constructor or destructor of your test suite fixture.
Instead of relying on a global singleton instance of XmlCheck you can also instantiate local instances of XmlCheck for some or all of your test cases:
All instances are independent from each other. A small disadvantage may be that you have to create and initialize all instances.