Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
#ifndef MANTID_ALGORITHMS_SORTXAXISTEST_H_
#define MANTID_ALGORITHMS_SORTXAXISTEST_H_
#include "MantidAlgorithms/SortXAxis.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidKernel/Workspace.h"
#include <cxxtest/TestSuite.h>
namespace {
MatrixWorkspace_sptr createWorkspace(const HistogramX &xData,
const HistogramY &yData,
const HistogramE &eData,
const int nSpec = 1) {
Workspace2D_sptr outWS = boost::make_shared<Workspace2D>();
outWS->initialize(nSpec, xData.size(), yData.size());
for (int i = 0; i < nSpec; ++i) {
outWS->mutableY(i) = yData;
outWS->mutableE(i) = eData;
outWS->mutableX(i) = xData;
}
outWS->getAxis(0)->unit() = UnitFactory::Instance().create("Wavelength");
return outWS;
}
class SortXAxisTest : public CxxTest::TestSuite {
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static SortXAxisTest *createSuite() { return new SortXAxisTest(); }
static void destroySuite(SortXAxisTest *suite) { delete suite; }
void testXAscending(){
std::vector<double> xData = {1,2,3};
std::vector<double> yData = {1,2,3};
std::vector<double> eData = {1,2,3};
MatrixWorkspace_sptr unsortedws = createWorkspace(xData, yData, eData);
SortXAxis alg;
alg.setProperty("InputWorkspacd", "unsortedws");
alg.setProperty("OutputWorkspace", "sortedws");
alg.execute();
MatrixWorkspace_sptr sortedws =
}
void testXDescending(){}
void testOnMultipleSpectrum(){}
void testSortsXHistogramAscending(){}
void testSortsXHistogramDescending(){}
void testSortXWorksChild(){}
void testDxMultipleSpectrum(){}
void testDxHistogramAscending(){}
void testSortDescending(){}
};
#endif /*MANTID_ALGORITHMS_SORTXAXISTEST_H_*/