TsUnitsOfMeasureManager.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 TsUnitsOfMeasureManager.h
22 
23  \brief Test suite for the Units of Measure Manager class.
24  */
25 
26 #ifndef __TERRALIB_UNITTEST_COMMON_INTERNAL_UOMM_H
27 #define __TERRALIB_UNITTEST_COMMON_INTERNAL_UOMM_H
28 
29 // TerraLib
30 //#include "Config.h"
31 #include "../../src/terralib/common/UnitsOfMeasureManager.h"
32 #include "../../src/terralib/common/UnitOfMeasure.h"
33 
34 // STL
35 #include <map>
36 #include <string>
37 #include <vector>
38 
39 // cppUnit
40 #include <cppunit/extensions/HelperMacros.h>
41 
42 /*!
43  \class TsUnitsOfMeasureManager
44 
45  \brief Test suite for the Units of Measure Manager Class.
46 
47  This test suite will check the following:
48  <ul>
49  <li> Initializes the manager with data from a json file. </li>
50  <li> Inserting new unit of measure. </li>
51  <li> Inserting new unit of measure with alternative names. </li>
52  <li> Removing an unit of measure from the manager. </li>
53  <li> Finding an unit of measure identified by it's identificaton number. </li>
54  <li> Finding an unit of measure identified by it's name. </li>
55  <li> Finding an unit of measure identified by one of it's alternative names. </li>
56  <li> Finding an unit of measure identified either by it's name or one of it's alternative names. </li>
57  <li> Returning a pair of iterators over the managed units of measure. </li>
58  <li> Clearing all the managed units. </li>
59  <li> Returning the alternative names for a unit of measure. </li>
60  <li> Calculating a multiplicative factor to convert from a given unit to its base unit and vice-versa. </li>
61  </ul>
62  */
63 
64 class TsUnitsOfMeasureManager : public CPPUNIT_NS::TestFixture
65 {
66 
67 // It registers this class as a Test Suit
69 
70 // It registers the class methods as Test Cases belonging to the suit
71 // CPPUNIT_TEST( tcFindUomById );
77 
79 
80  public:
81 
82 // It sets up context before running the test.
83  void setUp();
84 
85 // It cleans up after the test run.
86  void tearDown();
87 
88  protected:
89 
90 // Test Cases:
91 
92  /*! \brief Test Case: Find an unit of using it's identificaton number.
93  void tcFindUomById ();
94  */
95 
96  /*! \brief Test Case: Find an unit of using it's name. */
97  void tcFindUomByName ();
98 
99  /*! \brief Test Case: Find an unit of using one of it's alternative name. */
100  void tcFindUomByAltName ();
101 
102  /*! \brief Test Case: Find an unit of using either it's name or on e of it's alternative names. */
103  void tcFindUomByNames ();
104 
105  /* ! \brief Test Case: Returns the alternative names for a unit of measure.*/
106  void tcGeAltNames ();
107 
108  /* ! \brief Test Case: Calculates a multiplicative factor to convert from a given unit to its base unit and vice-versa.*/
109  void tcConvert ();
110 
111  private:
112 
117 
118  std::vector<std::string> alternativeNames;
119 
120 };
121 
122 #endif // __TERRALIB_UNITTEST_COMMON_INTERNAL_UOMM_H
void tcFindUomByAltName()
Test Case: Find an unit of using one of it&#39;s alternative name.
te::common::UnitOfMeasurePtr uomB
void tcFindUomByNames()
Test Case: Find an unit of using either it&#39;s name or on e of it&#39;s alternative names.
Test suite for the Units of Measure Manager Class.
te::common::UnitOfMeasurePtr uomC
te::common::UnitOfMeasurePtr uomA
boost::shared_ptr< UnitOfMeasure > UnitOfMeasurePtr
void tcFindUomByName()
Test Case: Find an unit of using it&#39;s identificaton number. void tcFindUomById ();.
std::vector< std::string > alternativeNames
te::common::UnitOfMeasurePtr uomD
CPPUNIT_TEST_SUITE(TsUnitsOfMeasureManager)
CPPUNIT_TEST(tcFindUomByName)