Skip to content

Commit

Permalink
refs #4328. Relocate and mock-test smart ptr.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Jan 17, 2012
1 parent 23c8661 commit 6cea8e6
Showing 1 changed file with 3 additions and 40 deletions.
43 changes: 3 additions & 40 deletions Code/Mantid/MantidQt/CustomInterfaces/test/WorkspaceMementoTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class WorkspaceMementoTest : public CxxTest::TestSuite

private:

/// Mock class
/// Mock Workspace Memento helper
class MockWorkspaceMemento : public WorkspaceMemento
{
public:
Expand All @@ -35,43 +35,6 @@ class MockWorkspaceMemento : public WorkspaceMemento
~MockWorkspaceMemento(){};
};

/// Helper type. Concrete Workspace Memento.
class ConcreteWorkspaceMemento : public WorkspaceMemento
{
public:

virtual std::string getId() const
{
throw std::runtime_error("Not implemented");
}

virtual std::string locationType() const
{
throw std::runtime_error("Not implemented");
}

virtual bool checkStillThere() const
{
throw std::runtime_error("Not implemented");
}

virtual Mantid::API::Workspace_sptr fetchIt(FetchProtocol) const
{
throw std::runtime_error("Not implemented");
}

virtual void cleanUp()
{
throw std::runtime_error("Not implemented");
}

virtual Mantid::API::Workspace_sptr applyActions()
{
throw std::runtime_error("Not implemented");
}
};


public:

void testGetEmptyUB()
Expand All @@ -98,13 +61,13 @@ class ConcreteWorkspaceMemento : public WorkspaceMemento

void testStatusWithoutUB()
{
ConcreteWorkspaceMemento memento;
MockWorkspaceMemento memento;
TS_ASSERT_EQUALS(WorkspaceMemento::NoOrientedLattice, memento.generateStatus());
}

void testStatusWithUB()
{
ConcreteWorkspaceMemento memento;
MockWorkspaceMemento memento;
memento.setUB(1, 2, 3, 4, 5, 6, 7, 8, 9);
TS_ASSERT_EQUALS(WorkspaceMemento::Ready, memento.generateStatus());
}
Expand Down

0 comments on commit 6cea8e6

Please sign in to comment.