summaryrefslogtreecommitdiff
path: root/examples/cppunittest/XmlUniformiserTest.h
blob: be2d6da435d6cddf97d5028f319b8e1c0a15dce6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef XMLUNIFORMISERTEST_H
#define XMLUNIFORMISERTEST_H

#include <cppunit/extensions/HelperMacros.h>


/*! \class XmlUniformiserTest
 * \brief Unit test for XmlUniformiser.
 */
class XmlUniformiserTest : public CPPUNIT_NS::TestFixture
{
  CPPUNIT_TEST_SUITE( XmlUniformiserTest );
  CPPUNIT_TEST( testEmpty );
  CPPUNIT_TEST( testSkipProcessed );
  CPPUNIT_TEST( testOpenElementWithoutAttributeButSomeSpaces );
  CPPUNIT_TEST( testOpenCloseElement );
  CPPUNIT_TEST( testElementWithEmptyAttribute );
  CPPUNIT_TEST( testElementWithEmptyAttributeButSomeSpaces );
  CPPUNIT_TEST( testElementWithOneAttribute );
  CPPUNIT_TEST( testElementWithThreeAttributes );
  CPPUNIT_TEST( testSkipComment );
  CPPUNIT_TEST( testElementWithContent );
  CPPUNIT_TEST( testElementsHierarchyWithContents );
  CPPUNIT_TEST( testAssertXmlEqual );
  CPPUNIT_TEST_SUITE_END();

public:
  /*! Constructs a XmlUniformiserTest object.
   */
  XmlUniformiserTest();

  /// Destructor.
  virtual ~XmlUniformiserTest();

  void setUp();
  void tearDown();

  void testEmpty();
  void testSkipProcessed();
  void testOpenElementWithoutAttributeButSomeSpaces();
  void testOpenCloseElement();
  void testElementWithEmptyAttribute();
  void testElementWithEmptyAttributeButSomeSpaces();
  void testElementWithOneAttribute();
  void testElementWithThreeAttributes();
  void testSkipComment();
  void testElementWithContent();
  void testElementsHierarchyWithContents();

  void testAssertXmlEqual();

private:
  void check( const std::string &xml, 
              const std::string &expectedStrippedXml );

  /// Prevents the use of the copy constructor.
  XmlUniformiserTest( const XmlUniformiserTest &copy );

  /// Prevents the use of the copy operator.
  void operator =( const XmlUniformiserTest &copy );

private:
};



#endif  // XMLUNIFORMISERTEST_H