1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include <test_HYDROData_Entity.h>
21 #include <HYDROData_Document.h>
22 #include <HYDROData_Entity.h>
26 void test_HYDROData_Entity::testName()
28 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
30 Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object
31 static const QString aName("test_name");
32 anObj->SetName(aName);
33 CPPUNIT_ASSERT_EQUAL(aName.toStdString(), anObj->GetName().toStdString());
38 void test_HYDROData_Entity::testRemove()
40 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
42 Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object
43 CPPUNIT_ASSERT(!anObj->IsRemoved());
45 CPPUNIT_ASSERT(anObj->IsRemoved());
50 void test_HYDROData_Entity::testCopy()
52 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
54 Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object
55 static const QString aName("test_name");
56 anObj->SetName(aName);
58 Handle(HYDROData_Entity) aCopy = aDoc->CreateObject(KIND_IMAGE); // object for copy
59 CPPUNIT_ASSERT(aCopy->GetName().isEmpty());
62 // check the copied object has same name as original
63 CPPUNIT_ASSERT_EQUAL(aName.toStdString(), aCopy->GetName().toStdString());