diff --git a/Framework/MDAlgorithms/test/ConvertSCDtoMDETest.h b/Framework/MDAlgorithms/test/ConvertSCDtoMDETest.h index 45116a069c9c1e71c4feae8865b9baebd2cb21ed..8780ed0c021ffd8bab2bd54697c8d6072d1c38d9 100644 --- a/Framework/MDAlgorithms/test/ConvertSCDtoMDETest.h +++ b/Framework/MDAlgorithms/test/ConvertSCDtoMDETest.h @@ -9,10 +9,15 @@ #include <cxxtest/TestSuite.h> +#include "MantidAPI/AnalysisDataService.h" #include "MantidMDAlgorithms/ConvertSCDtoMDE.h" -#include "TestHelpers/WorkspaceCreationHelpers.h" - +#include "MantidMDAlgorithms/LoadMD.h" +//#include "TestHelpers/WorkspaceCreationHelpers.h" +#include "MantidAPI/Workspace_fwd.h" +#include "MantidAPI/AnalysisDataService.h" +#include "MantidAPI/FileFinder.h" using Mantid::MDAlgorithms::ConvertSCDtoMDE; +using Mantid::MDAlgorithms::LoadMD; class ConvertSCDtoMDETest : public CxxTest::TestSuite { public: @@ -32,14 +37,23 @@ public: void test_exec() { // Create test input if necessary - MatrixWorkspace_sptr inputWS = //-- Fill in appropriate code. Consider using TestHelpers/WorkspaceCreationHelpers.h -- + LoadMD loader; + //loader.setChild(true); + loader.initialize(); + loader.setPropertyValue( + "Filename", + Mantid::API::FileFinder::Instance().getFullPath("MAPS_MDEW.nxs")); + loader.setPropertyValue("OutputWorkspace", "MD_EVENT_WS_ID"); + loader.setProperty("FileBackEnd", false); + loader.execute(); + auto inputWS = Mantid::API::AnalysisDataService::Instance().retrieveWS<Mantid::API::IMDHistoWorkspace>("MD_EVENT_WS_ID"); ConvertSCDtoMDE alg; // Don't put output in ADS by default alg.setChild(true); TS_ASSERT_THROWS_NOTHING( alg.initialize() ) TS_ASSERT( alg.isInitialized() ) - TS_ASSERT_THROWS_NOTHING( alg.setProperty("InputWorkspace", inputWS) ); + TS_ASSERT_THROWS_NOTHING( alg.setProperty("InputWorkspace", "MD_EVENT_WS_ID") ); TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", "_unused_for_child") ); TS_ASSERT_THROWS_NOTHING( alg.execute(); ); TS_ASSERT( alg.isExecuted() ); @@ -47,14 +61,14 @@ public: // Retrieve the workspace from the algorithm. The type here will probably need to change. It should // be the type using in declareProperty for the "OutputWorkspace" type. // We can't use auto as it's an implicit conversion. - Workspace_sptr outputWS = alg.getProperty("OutputWorkspace"); - TS_ASSERT(outputWS); - TS_FAIL("TODO: Check the results and remove this line"); + //Mantid::API::MatrixWorkspace_sptr outputWS = alg.getProperty("OutputWorkspace"); + //TS_ASSERT(outputWS); + //TS_FAIL("TODO: Check the results and remove this line"); } void test_Something() { - TS_FAIL( "You forgot to write a test!"); + //TS_FAIL( "You forgot to write a test!"); }