44 event_A = MDEventsTestHelper::makeMDEW<2>(3, 0.0, 10.0, 1);
45 event_B = MDEventsTestHelper::makeMDEW<2>(3, 0.0, 10.0, 1);
61 const std::string &outName,
bool succeeds,
const std::string &otherProp,
62 const std::string &otherPropValue) {
67 alg->setPropertyValue(
"LHSWorkspace", lhs);
68 alg->setPropertyValue(
"RHSWorkspace",
rhs);
69 alg->setPropertyValue(
"OutputWorkspace", outName);
70 if (!otherProp.empty())
71 alg->setPropertyValue(otherProp, otherPropValue);
74 if (!alg->isExecuted())
75 throw std::runtime_error(
"Algorithm " + algoName +
" did not succeed.");
78 throw std::runtime_error(
"Algorithm " + algoName +
" did not create the output workspace.");
79 return std::dynamic_pointer_cast<MDHistoWorkspace>(out);
81 if (alg->isExecuted())
82 throw std::runtime_error(
"Algorithm " + algoName +
" did not fail as expected.");
92 bool succeeds,
const std::string &otherProp,
const std::string &otherPropValue) {
102 alg->setPropertyValue(
"InputWorkspace", inName);
103 alg->setPropertyValue(
"OutputWorkspace", outName);
104 if (!otherProp.empty())
105 alg->setPropertyValue(otherProp, otherPropValue);
108 if (!alg->isExecuted())
109 throw std::runtime_error(
"Algorithm " + algoName +
" did not succeed.");
112 throw std::runtime_error(
"Algorithm " + algoName +
" did not create the output workspace.");
113 return std::dynamic_pointer_cast<MDHistoWorkspace>(out);
115 if (alg->isExecuted())
116 throw std::runtime_error(
"Algorithm " + algoName +
" did not fail as expected.");
const std::vector< double > & rhs
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
DLLExport Mantid::DataObjects::MDHistoWorkspace_sptr doTest(const std::string &algoName, const std::string &lhs, const std::string &rhs, const std::string &outName, bool succeeds=true, const std::string &otherProp="", const std::string &otherPropValue="")
Run a binary algorithm.
void setUpBinaryOperationMDTestHelper()
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< IMDWorkspace > IMDWorkspace_sptr
Shared pointer to the IMDWorkspace base class.
static MatrixWorkspace_sptr createWorkspaceSingleValue(const double &rhsValue)
Creates a temporary single value workspace the error is set to zero.
MDHistoWorkspace_sptr makeFakeMDHistoWorkspace(double signal, size_t numDims, size_t numBins=10, coord_t max=10.0, double errorSquared=1.0, const std::string &name="", double numEvents=1.0)
Make a fake n-dimensional MDHistoWorkspace.
std::shared_ptr< WorkspaceSingleValue > WorkspaceSingleValue_sptr
shared pointer to the WorkspaceSingleValue class
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
Helper class which provides the Collimation Length for SANS instruments.
DLLExport Mantid::DataObjects::MDHistoWorkspace_sptr doTest(const std::string &algoName, const std::string &inName, const std::string &outName, bool succeeds=true, const std::string &otherProp="", const std::string &otherPropValue="")
Run a unary algorithm.