Skip to content

Commit

Permalink
Changed the VATES tests so they don't use setName(). Re #7253
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Jun 10, 2013
1 parent 75e6a70 commit 6ed6dc7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
13 changes: 3 additions & 10 deletions Code/Mantid/Vates/VatesAPI/test/MDEWRebinningPresenterTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,7 @@ class MDEWRebinningPresenterTest : public CxxTest::TestSuite
{
// Create a MDWorkspace and put it into the ADS.
const std::string wsName = "TestMDEW";
auto someMDEW = Mantid::MDEvents::MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>,3>(10,0,10);
someMDEW->setName(wsName);
Mantid::API::AnalysisDataService::Instance().addOrReplace(wsName, someMDEW);
auto someMDEW = Mantid::MDEvents::MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>,3>(10,0,10,0,wsName);

// Generate xml relating to the dimensionality etc. by querying this workspace.
RebinningKnowledgeSerializer serializer(LocationNotRequired);
Expand Down Expand Up @@ -467,9 +465,7 @@ class MDEWRebinningPresenterTest : public CxxTest::TestSuite
void testTimeLabelAfterRebinFor4DData()
{
const std::string wsName = "TestMDEW";
auto someMDEW = Mantid::MDEvents::MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<4>,4>(10,0,10);
someMDEW->setName(wsName);
Mantid::API::AnalysisDataService::Instance().addOrReplace(wsName, someMDEW);
auto someMDEW = Mantid::MDEvents::MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<4>,4>(10,0,10,0,wsName);

RebinningKnowledgeSerializer serializer(LocationNotRequired);
serializer.setWorkspace(someMDEW);
Expand Down Expand Up @@ -505,9 +501,7 @@ class MDEWRebinningPresenterTest : public CxxTest::TestSuite
void testAxisLabelsAfterRebinFor3DData()
{
const std::string wsName = "TestMDEW";
auto someMDEW = Mantid::MDEvents::MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>,3>(10,0,10);
someMDEW->setName(wsName);
Mantid::API::AnalysisDataService::Instance().addOrReplace(wsName, someMDEW);
auto someMDEW = Mantid::MDEvents::MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<3>,3>(10,0,10,0,wsName);

RebinningKnowledgeSerializer serializer(LocationNotRequired);
serializer.setWorkspace(someMDEW);
Expand Down Expand Up @@ -557,7 +551,6 @@ class MDEWRebinningPresenterTest : public CxxTest::TestSuite
{
const std::string wsName = "TestMDEW";
auto someMDEW = Mantid::MDEvents::MDEventsTestHelper::makeAnyMDEW<MDLeanEvent<4>,4>(10,0,10);
someMDEW->setName(wsName);
Mantid::API::AnalysisDataService::Instance().addOrReplace(wsName, someMDEW);

RebinningKnowledgeSerializer serializer(LocationNotRequired);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class MDHWInMemoryLoadingPresenterTest: public CxxTest::TestSuite
// Helper method. Generates and returns a valid IMDHistoWorkspace
static Mantid::API::Workspace_sptr getGoodWorkspace()
{
Mantid::MDEvents::MDHistoWorkspace_sptr ws = makeFakeMDHistoWorkspace(1.0, 4, 5, 1.0, 0.1);
ws->setName("MD_HISTO_WS");
Mantid::MDEvents::MDHistoWorkspace_sptr ws = makeFakeMDHistoWorkspace(1.0, 4, 5, 1.0, 0.1,"MD_HISTO_WS");
return ws;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "MantidAPI/IMDWorkspace.h"
#include "MantidGeometry/MDGeometry/MDImplicitFunction.h"
#include "MantidKernel/System.h"
#include "MantidAPI/AnalysisDataService.h"
#include <boost/shared_ptr.hpp>
#include "MockObjects.h"

Expand Down Expand Up @@ -47,8 +48,8 @@ void testNoWorkspaceThrows()
void testNoLocationDoesNotThrow()
{
MockIMDWorkspace* pWorkspace = new MockIMDWorkspace;
pWorkspace->setName("someName");
Mantid::API::IMDWorkspace_sptr workspace(pWorkspace);
Mantid::API::AnalysisDataService::Instance().addOrReplace("someName",workspace);

MockImplicitFunction* pImpFunction = new MockImplicitFunction;
EXPECT_CALL(*pImpFunction, toXMLString()).Times(1).WillRepeatedly(testing::Return("<ImplicitFunction/>"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class vtkSplatterPlotFactoryTest : public CxxTest::TestSuite
void testInitalizeWithWrongWorkspaceTypeThrows()
{
IMDWorkspace* ws = new MockIMDWorkspace;
ws->setName("OTHER_WS_TYPE");

vtkSplatterPlotFactory factory(ThresholdRange_scptr(new UserDefinedThresholdRange(0, 1)), "signal");
TSM_ASSERT_THROWS("This is an invalid workspace. Should throw.", factory.initialize( Workspace_sptr(ws) ), std::invalid_argument);
Expand Down

0 comments on commit 6ed6dc7

Please sign in to comment.