Salome HOME
test on types after operations
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_LandCoverMap.cxx
index e715c51d4d0409224677e93b282bf8e1fadd1a03..b2c3ac69534cdae00d138ae0a9ba00461bce8cf9 100644 (file)
@@ -20,6 +20,7 @@
 #include <HYDROData_Document.h>
 #include <HYDROData_LandCoverMap.h>
 #include <HYDROData_PolylineXY.h>
+#include <HYDROData_Tool.h>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Wire.hxx>
 #include <TopoDS_Face.hxx>
@@ -85,7 +86,14 @@ void test_HYDROData_LandCoverMap::test_add_2_objects()
   TestViewer::show( aMap->GetShape(), AIS_Shaded, true );
   TestViewer::AssertEqual( "LandCoverMap_Add_2_Objects" );
 
-  //TODO: check the types
+  HYDROData_LandCoverMap::Iterator anIt( aMap );
+  CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
+  CPPUNIT_ASSERT_EQUAL( QString( "test1" ), anIt.StricklerType() );
+  anIt.Next();
+  CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
+  CPPUNIT_ASSERT_EQUAL( QString( "test2" ), anIt.StricklerType() );
+  anIt.Next();
+  CPPUNIT_ASSERT_EQUAL( false, anIt.More() );
 
   aDoc->Close();
 }
@@ -113,7 +121,14 @@ void test_HYDROData_LandCoverMap::test_split_by_polyline()
   //TestViewer::show( aWire, QColor(), 0 );
   TestViewer::AssertEqual( "LandCoverMap_Split_1" );
 
-  //TODO: check the types
+  HYDROData_LandCoverMap::Iterator anIt( aMap );
+  CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
+  CPPUNIT_ASSERT_EQUAL( QString( "test1" ), anIt.StricklerType() );
+  anIt.Next();
+  CPPUNIT_ASSERT_EQUAL( true, anIt.More() );
+  CPPUNIT_ASSERT_EQUAL( QString( "test1" ), anIt.StricklerType() );
+  anIt.Next();
+  CPPUNIT_ASSERT_EQUAL( false, anIt.More() );
 
   aDoc->Close();
 }