Commit 4b881545 authored by Silke Schomann's avatar Silke Schomann
Browse files

Added unit test to test findContainer without specified ID

SampleEnvironmentSpec::findContainer does not need to specify a container ID anymore when the sample environment only has a single container.
parent 6489c475
......@@ -47,6 +47,20 @@ public:
TS_ASSERT_EQUALS(testContainer, retrieved);
}
void test_Find_Single_Container_Without_ID() {
using Mantid::Geometry::Container;
SampleEnvironmentSpec spec("CRYO-001");
auto testContainer = std::make_shared<Container>("");
testContainer->setID("8mm");
TS_ASSERT_EQUALS(0, spec.ncans());
TS_ASSERT_THROWS_NOTHING(spec.addContainer(testContainer));
TS_ASSERT_EQUALS(1, spec.ncans());
auto retrieved = spec.findContainer("");
TS_ASSERT(retrieved);
TS_ASSERT_EQUALS(testContainer, retrieved);
}
void test_AddObject_Stores_Reference_To_Object() {
SampleEnvironmentSpec spec("CRYO-001");
......
Supports Markdown
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