Skip to content

Commit

Permalink
Re #5371. Test for failure as well as success.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Aug 6, 2012
1 parent 36c0c06 commit 13357fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Code/Mantid/Framework/API/test/WorkspaceGroupTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ class WorkspaceGroupTest : public CxxTest::TestSuite
WorkspaceGroup_sptr group = makeGroup();
Workspace_sptr ws1 = group->getItem(1);
TS_ASSERT_EQUALS( ws1->name(), "ws1");
// Test the 'by name' overload
Workspace_sptr ws11 = group->getItem("ws1");
TS_ASSERT_EQUALS( ws1, ws11 );
// Test for failure too
TS_ASSERT_THROWS( group->getItem("non-existent"), std::out_of_range);
TS_ASSERT_THROWS( group->getItem(""), std::out_of_range);
AnalysisDataService::Instance().clear();
}

Expand Down

0 comments on commit 13357fa

Please sign in to comment.