23 CPPUNIT_TEST_SUITE(mitkPointSetPointOperationsTestSuite);
25 MITK_TEST(TestCreateOperationAndAddPoint);
28 MITK_TEST(TestPointOperationOpSelectPoint);
34 CPPUNIT_TEST_SUITE_END();
51 pointSet->InsertPoint(2, point2);
52 pointSet->InsertPoint(3, point3);
53 pointSet->InsertPoint(4, point4);
56 void tearDown()
override
62 void TestCreateOperationAndAddPoint()
70 pointSet->ExecuteOperation(doOp);
71 CPPUNIT_ASSERT_EQUAL_MESSAGE(
72 "check if added points exists",
true, pointSet->GetSize() == 4 && pointSet->IndexExists(
id));
77 tempPoint = pointSet->GetPoint(
id);
79 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check if added point contains real value",
true, point == tempPoint);
82 void TestPointOperationOpMove()
92 pointSet->ExecuteOperation(doOp);
93 tempPoint = pointSet->GetPoint(
id);
95 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpMove ",
true, tempPoint == point1);
108 void TestPointOperationOpRemove()
115 point = pointSet->GetPoint(
id);
119 pointSet->ExecuteOperation(doOp);
120 tempPoint = pointSet->GetPoint(
id);
122 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpREMOVE ",
false, pointSet->IndexExists(
id));
135 void TestPointOperationOpSelectPoint()
142 pointSet->ExecuteOperation(doOp);
144 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpSELECTPOINT ",
true, pointSet->GetSelectInfo(3));
157 void TestOpDeselectPoint()
164 pointSet->ExecuteOperation(doOp);
166 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpDESELECTPOINT ",
false, pointSet->GetSelectInfo(4));
167 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check GetNumeberOfSelected ",
true, pointSet->GetNumberOfSelected() == 0);
188 void TestOpMovePointUp()
198 pointSet->ExecuteOperation(doOp);
201 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpMOVEPOINTUP ",
true, tempPoint == point);
214 void TestOpMovePointDown()
223 pointSet->ExecuteOperation(doOp);
226 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"check PointOperation OpMOVEPOINTDOWN ",
true, tempPoint == point);
238 void TestOpMovePointUpOnFirstPoint()
247 pointSet->ExecuteOperation(doOp);
252 CPPUNIT_ASSERT_EQUAL_MESSAGE(
253 "check PointOperation OpMOVEPOINTUP for point id 1: ",
true, ((newP1 == p1) && (newP2 == p2)));
MITK_TEST_SUITE_REGISTRATION(mitkImageToItk)
#define MITK_TEST(TESTMETHOD)
Adds a test to the current test suite.
Constants for most interaction classes, due to the generic StateMachines.
Test fixture for parameterized tests.
Operation that handles all actions on one Point.