TsUnitOfMeasure.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file TsUnitsOfMeasure.h
22 
23  \brief Test suite for the Units of measure class.
24  */
25 
26 #ifndef __TERRALIB_UNITTEST_COMMON_INTERNAL_UOM_H
27 #define __TERRALIB_UNITTEST_COMMON_INTERNAL_UOM_H
28 
29 // TerraLib
30 //#include "Config.h"
31 
32 // cppUnit
33 #include <cppunit/extensions/HelperMacros.h>
34 
35 /*!
36  \class TsUnitsOfMeasure
37 
38  \brief Test suite for the Units of Measure Class.
39 
40  This test suite will check the following:
41  <ul>
42  <li> Inserting new unit of measure. </li>
43  <li> Inserting new unit of measure with alternative names. </li>
44  <li> Removing an unit of measure from the manager. </li>
45  <li> Finding an unit of measure identified by it's identificaton number. </li>
46  <li> Finding an unit of measure identified by it's name. </li>
47  <li> Finding an unit of measure identified by one of it's alternative names. </li>
48  <li> Finding an unit of measure identified either by it's name or one of it's alternative names. </li>
49  <li> Returning a pair of iterators over the managed units of measure. </li>
50  <li> Clearing all the managed units. </li>
51  <li> Returning the alternative names for a unit of measure. </li>
52  <li> Calculating a multiplicative factor to convert from a given unit to its base unit and vice-versa. </li>
53  </ul>
54  */
55 
56 class TsUnitOfMeasure : public CPPUNIT_NS::TestFixture
57 {
58 
59  // It registers this class as a Test Suit
61 
62  // It registers the class methods as Test Cases belonging to the suit
72 
74 
75  public:
76 
77 // It sets up context before running the test.
78  void setUp();
79 
80 // It cleans up after the test run.
81  void tearDown();
82 
83  protected:
84 
85  // Test Cases:
86 
87  /*! \brief Test Case: Checks the unit of measure identification */
88  void tcGetId();
89 
90  /*! \brief Test Case: Checks the unit of measure name */
91  void tcGetName();
92 
93  /*! \brief Test Case: Checks the unit of measure description */
94  void tcGetDescription();
95 
96  /*! \brief Test Case: Checks the unit of measure symbol */
97  void tcGetSymbol();
98 
99  /*! \brief Test Case: Checks the unit of measure type */
100  void tcGetType();
101 
102  /*! \brief Test Case: Checks if it is returning true for a base unit and false for non-base units. */
103  void tcIsBaseUnit();
104 
105  /*! \brief Test Case: Checks the base unit id from which this unit derives of */
106  void tcGetBaseUnitId();
107 
108  /*! \brief Test Case: Checks if the conversion factors to convert the unit to its base unit are correct */
109  void tcGetConversionFactors();
110 
111  /*! \brief Test Case: Checks the multiplicative value to convert the unit to its base unit */
112  void tcGetConversionValue();
113 
114  private:
115 
120 
121 };
122 
123 #endif // __TERRALIB_UNITTEST_COMMON_INTERNAL_UOM_H
te::common::UnitOfMeasure * uomB
void tcIsBaseUnit()
Test Case: Checks if it is returning true for a base unit and false for non-base units.
void tcGetName()
Test Case: Checks the unit of measure name.
CPPUNIT_TEST_SUITE(TsUnitOfMeasure)
void tcGetDescription()
Test Case: Checks the unit of measure description.
void tcGetBaseUnitId()
Test Case: Checks the base unit id from which this unit derives of.
void tcGetConversionFactors()
Test Case: Checks if the conversion factors to convert the unit to its base unit are correct...
void tcGetType()
Test Case: Checks the unit of measure type.
void tcGetSymbol()
Test Case: Checks the unit of measure symbol.
te::common::UnitOfMeasure * uomA
A class to represent units of measure.
Definition: UnitOfMeasure.h:74
CPPUNIT_TEST(tcGetId)
void tcGetId()
Test Case: Checks the unit of measure identification.
te::common::UnitOfMeasure * uomC
void tcGetConversionValue()
Test Case: Checks the multiplicative value to convert the unit to its base unit.
te::common::UnitOfMeasure * uomD