Newer
Older
#ifndef MUONREMOVEEXPDECAYTEST_H_
#define MUONREMOVEEXPDECAYTEST_H_
//This test does not compile on Windows64 as is does not support HDF4 files
#ifndef _WIN64
#include <cxxtest/TestSuite.h>
#include "MantidDataHandling/LoadInstrument.h"
#include "MantidNexus/LoadMuonNexus.h"
#include "MantidAlgorithms/MuonRemoveExpDecay.h"
#include "MantidAPI/Workspace.h"
#include "MantidDataObjects/Workspace2D.h"
#include "MantidAPI/AnalysisDataService.h"
#include <stdexcept>
using namespace Mantid::Algorithms;
using namespace Mantid::API;
class MuonRemoveExpDecayTest : public CxxTest::TestSuite
{
public:
void testName()
{
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
}
void testCategory()
{
TS_ASSERT_EQUALS( alg.category(), "Muon" )
}
void testInit()
{
alg.initialize();
TS_ASSERT( alg.isInitialized() )
}
void testLoadNexusAndSetProperties()
{
loader.initialize();
loader.setPropertyValue("Filename", "../../../../Test/Nexus/emu00006473.nxs");
loader.setPropertyValue("OutputWorkspace", "EMU6473");
TS_ASSERT_THROWS_NOTHING( loader.execute() );
TS_ASSERT_EQUALS(loader.isExecuted(),true);
alg.setPropertyValue("InputWorkspace", "EMU6473");
alg.setPropertyValue("OutputWorkspace", "Result");
alg.setPropertyValue("Spectra", "0");
}
void testProperties()
{
TS_ASSERT_EQUALS( alg.getPropertyValue("Spectra"), "0");
}
void testExecute()
{
try
{
TS_ASSERT_EQUALS(alg.execute(),true);
}
catch(std::runtime_error e)
{
TS_FAIL(e.what());
}
Workspace_const_sptr outputWS = AnalysisDataService::Instance().retrieve("Result");
}
private:
MuonRemoveExpDecay alg;
Mantid::NeXus::LoadMuonNexus loader;
};
#endif /*MUONREMOVEEXPDECAYTEST_H_*/