Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
419a73cc
Commit
419a73cc
authored
9 years ago
by
Raquel Alvarez Banos
Browse files
Options
Downloads
Patches
Plain Diff
Re #13968 Just replaced the alg to use the AlgorithmManager
parent
d996b9a7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/Algorithms/test/RemoveExpDecayTest.h
+31
-29
31 additions, 29 deletions
Framework/Algorithms/test/RemoveExpDecayTest.h
with
31 additions
and
29 deletions
Framework/Algorithms/test/RemoveExpDecayTest.h
+
31
−
29
View file @
419a73cc
...
@@ -3,10 +3,9 @@
...
@@ -3,10 +3,9 @@
#include
<cxxtest/TestSuite.h>
#include
<cxxtest/TestSuite.h>
#include
"MantidAPI/FrameworkManager.h"
#include
"MantidAPI/FrameworkManager.h"
#include
"MantidAlgorithm
s/RemoveExpDecay
.h"
#include
"Mantid
API/
Algorithm
Manager
.h"
#include
"MantidTestHelpers/WorkspaceCreationHelper.h"
#include
"MantidTestHelpers/WorkspaceCreationHelper.h"
using
namespace
Mantid
::
Algorithms
;
using
namespace
Mantid
::
API
;
using
namespace
Mantid
::
API
;
const
std
::
string
outputName
=
"MuonRemoveExpDecay_Output"
;
const
std
::
string
outputName
=
"MuonRemoveExpDecay_Output"
;
...
@@ -21,51 +20,54 @@ public:
...
@@ -21,51 +20,54 @@ public:
RemoveExpDecayTest
()
{
FrameworkManager
::
Instance
();
}
RemoveExpDecayTest
()
{
FrameworkManager
::
Instance
();
}
void
testInit
()
{
void
testInit
()
{
Muon
RemoveExpDecay
alg
;
IAlgorithm_sptr
alg
=
AlgorithmManager
::
Instance
().
create
(
"
RemoveExpDecay
"
)
;
alg
.
initialize
();
alg
->
initialize
();
TS_ASSERT
(
alg
.
isInitialized
())
TS_ASSERT
(
alg
->
isInitialized
())
}
}
void
testExecute
()
{
void
testExecute
()
{
auto
ws
=
WorkspaceCreationHelper
::
Create2DWorkspace
(
1
,
1
);
auto
ws
=
WorkspaceCreationHelper
::
Create2DWorkspace
(
1
,
1
);
MuonRemoveExpDecay
alg
;
IAlgorithm_sptr
alg
=
AlgorithmManager
::
Instance
().
create
(
"RemoveExpDecay"
);
TS_ASSERT_THROWS_NOTHING
(
alg
.
initialize
());
alg
->
initialize
();
TS_ASSERT
(
alg
.
isInitialized
());
alg
->
setChild
(
true
);
alg
.
setChild
(
true
);
alg
->
setProperty
(
"InputWorkspace"
,
ws
);
alg
.
setProperty
(
"InputWorkspace"
,
ws
);
alg
->
setPropertyValue
(
"OutputWorkspace"
,
outputName
);
alg
.
setPropertyValue
(
"OutputWorkspace"
,
outputName
);
alg
->
setPropertyValue
(
"Spectra"
,
"0"
);
alg
.
setPropertyValue
(
"Spectra"
,
"0"
);
TS_ASSERT_THROWS_NOTHING
(
alg
->
execute
());
TS_ASSERT_THROWS_NOTHING
(
alg
.
execute
());
TS_ASSERT
(
alg
->
isExecuted
());
TS_ASSERT
(
alg
.
isExecuted
())
MatrixWorkspace_sptr
outWS
=
alg
->
getProperty
(
"OutputWorkspace"
);
}
}
void
testExecuteWhereSepctraNotSet
()
{
void
testExecuteWhereSepctraNotSet
()
{
auto
ws
=
WorkspaceCreationHelper
::
Create2DWorkspace
(
1
,
1
);
auto
ws
=
WorkspaceCreationHelper
::
Create2DWorkspace
(
1
,
1
);
MuonRemoveExpDecay
alg
;
IAlgorithm_sptr
alg
=
AlgorithmManager
::
Instance
().
create
(
"RemoveExpDecay"
);
TS_ASSERT_THROWS_NOTHING
(
alg
.
initialize
());
alg
->
initialize
();
TS_ASSERT
(
alg
.
isInitialized
());
alg
->
setChild
(
true
);
alg
.
setChild
(
true
);
alg
->
setProperty
(
"InputWorkspace"
,
ws
);
alg
.
setProperty
(
"InputWorkspace"
,
ws
);
alg
->
setPropertyValue
(
"OutputWorkspace"
,
outputName
);
alg
.
setPropertyValue
(
"OutputWorkspace"
,
outputName
);
TS_ASSERT_THROWS_NOTHING
(
alg
->
execute
());
TS_ASSERT_THROWS_NOTHING
(
alg
.
execute
());
TS_ASSERT
(
alg
->
isExecuted
())
TS_ASSERT
(
alg
.
isExecuted
())
MatrixWorkspace_sptr
outWS
=
alg
->
getProperty
(
"OutputWorkspace"
);
}
}
void
test_yUnitLabel
()
{
void
test_yUnitLabel
()
{
auto
ws
=
WorkspaceCreationHelper
::
Create2DWorkspace
(
1
,
1
);
auto
ws
=
WorkspaceCreationHelper
::
Create2DWorkspace
(
1
,
1
);
Muon
RemoveExpDecay
alg
;
IAlgorithm_sptr
alg
=
AlgorithmManager
::
Instance
().
create
(
"
RemoveExpDecay
"
)
;
alg
.
initialize
();
alg
->
initialize
();
alg
.
setChild
(
true
);
alg
->
setChild
(
true
);
alg
.
setProperty
(
"InputWorkspace"
,
ws
);
alg
->
setProperty
(
"InputWorkspace"
,
ws
);
alg
.
setProperty
(
"OutputWorkspace"
,
outputName
);
alg
->
setProperty
Value
(
"OutputWorkspace"
,
outputName
);
alg
.
execute
();
alg
->
execute
();
MatrixWorkspace_sptr
result
=
alg
.
getProperty
(
"OutputWorkspace"
);
MatrixWorkspace_sptr
result
=
alg
->
getProperty
(
"OutputWorkspace"
);
TS_ASSERT
(
result
);
TS_ASSERT
(
result
);
TS_ASSERT_EQUALS
(
result
->
YUnitLabel
(),
"Asymmetry"
);
TS_ASSERT_EQUALS
(
result
->
YUnitLabel
(),
"Asymmetry"
);
}
}
};
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment