Commit 518bdd3b authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Fixed testcase: setting an empty ID should remove the ID.

parent 1a12895f
......@@ -463,18 +463,6 @@ void TestCore::testModelCreateSubNode()
expectedCalls << TestView::MethodCall("nodeIdChanged", QStringList() << "Blah" << "Blah" << "");
QCOMPARE(view->methodCalls(), expectedCalls);
try {
childNode.setId("");
QFAIL("Setting an invalid id does not throw an exception");
} catch (Exception &exception) {
QCOMPARE(exception.type(), QString("InvalidIdException"));
}
try {
childNode.setId(QString());
QFAIL("Setting an invalid id does not throw an exception");
} catch (Exception &exception) {
QCOMPARE(exception.type(), QString("InvalidIdException"));
}
try {
childNode.setId("invalid id");
QFAIL("Setting an invalid id does not throw an excxeption");
......@@ -484,6 +472,9 @@ void TestCore::testModelCreateSubNode()
QCOMPARE(childNode.id(), QString("Blah"));
QCOMPARE(view->methodCalls(), expectedCalls);
childNode.setId(QString());
QVERIFY(childNode.id().isEmpty());
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment