summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <[email protected]>2015-06-11 15:46:51 +0200
committerRalf Habacker <[email protected]>2015-06-12 07:58:55 +0200
commit12b2baa32dab542a10e70f74c0a8807647584122 (patch)
treed6d639ed38939eb3a3d1dc09216cb95b771bf1a4
parentb42689de5cd3c9a131220bb5a3e2e021ee929ab3 (diff)
Add more resolveRef() to UMLObject checks.
-rw-r--r--unittests/TEST_umlobject.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/unittests/TEST_umlobject.cpp b/unittests/TEST_umlobject.cpp
index b65606d..ae01349 100644
--- a/unittests/TEST_umlobject.cpp
+++ b/unittests/TEST_umlobject.cpp
@@ -70,12 +70,27 @@ void TEST_UMLObject::test_clone()
void TEST_UMLObject::test_resolveRef()
{
UMLPackage parent("Test Parent");
- //UMLStereotype stereotype("test");
UMLStereotype *stereotype = UMLApp::app()->document()->createStereotype("test");
+
UMLObject a("Test A");
+ // no resolve
a.setUMLPackage(&parent);
+ QCOMPARE(a.resolveRef(), true);
+
+ // secondary
a.setSecondaryId(Uml::ID::toString(stereotype->id()));
QCOMPARE(a.resolveRef(), true);
+
+ // secondary fallback
+ a.setSecondaryId(QLatin1String(""));
+ a.setSecondaryFallback(Uml::ID::toString(stereotype->id()));
+ QCOMPARE(a.resolveRef(), true);
+
+ UMLObject b("Test B");
+ UMLStereotype stereotype2("test");
+ b.setUMLPackage(&parent);
+ b.setSecondaryId(Uml::ID::toString(stereotype2.id()));
+ QCOMPARE(!b.resolveRef(), true);
}
void TEST_UMLObject::test_setBaseType()