MockObjects.h 5.55 KB
Newer Older
1
2
3
4
5
6
7
/*
 * MockObjects.h
 *
 *  Created on: Apr 8, 2014
 *      Author: spu92482
 */

Owen Arnold's avatar
Owen Arnold committed
8
9
#ifndef MANTIDGEOMETRYTEST_MOCKOBJECTS_H_
#define MANTIDGEOMETRYTEST_MOCKOBJECTS_H_
10

11
#include "MantidGeometry/Crystal/IPeak.h"
Owen Arnold's avatar
Owen Arnold committed
12
13
#include "MantidGeometry/Crystal/PeakTransform.h"
#include "MantidGeometry/Crystal/PeakTransformFactory.h"
14
#include "MantidGeometry/Objects/InstrumentRayTracer.h"
Owen Arnold's avatar
Owen Arnold committed
15
#include "MantidKernel/SpecialCoordinateSystem.h"
16
#include "MantidKernel/WarningSuppressions.h"
17
18
19
#include <boost/regex.hpp>
#include <gmock/gmock.h>

Owen Arnold's avatar
Owen Arnold committed
20
using namespace Mantid::Geometry;
21
22
23
using namespace Mantid;
using boost::regex;

24
namespace {
25

26
GCC_DIAG_OFF_SUGGEST_OVERRIDE
27

28
29
30
31
32
33
34
35
/*------------------------------------------------------------
 Mock Peak Transform
 ------------------------------------------------------------*/
class MockPeakTransform : public PeakTransform {
public:
  MockPeakTransform()
      : PeakTransform("H (Lattice)", "K (Lattice)", regex("^H.*$"),
                      regex("^K.*$"), regex("^L.*$")) {}
36
  ~MockPeakTransform() override {}
37
38
39
40
41
42
43
44
45
  MOCK_CONST_METHOD0(clone, PeakTransform_sptr());
  MOCK_CONST_METHOD1(transform,
                     Mantid::Kernel::V3D(const Mantid::Kernel::V3D &));
  MOCK_CONST_METHOD1(transformPeak,
                     Mantid::Kernel::V3D(const Mantid::Geometry::IPeak &));
  MOCK_CONST_METHOD0(getFriendlyName, std::string());
  MOCK_CONST_METHOD0(getCoordinateSystem,
                     Mantid::Kernel::SpecialCoordinateSystem());
};
46

47
48
49
50
51
52
53
54
55
/*------------------------------------------------------------
 Mock Peak Transform Factory
 ------------------------------------------------------------*/
class MockPeakTransformFactory : public PeakTransformFactory {
public:
  MOCK_CONST_METHOD0(createDefaultTransform, PeakTransform_sptr());
  MOCK_CONST_METHOD2(createTransform, PeakTransform_sptr(const std::string &,
                                                         const std::string &));
};
56

57
58
59
60
61
/*------------------------------------------------------------
Mock IPeak
------------------------------------------------------------*/
class MockIPeak : public Mantid::Geometry::IPeak {
public:
62
63
  MOCK_METHOD1(setInstrument,
               void(const Geometry::Instrument_const_sptr &inst));
64
65
66
67
68
  MOCK_CONST_METHOD0(getDetectorID, int());
  MOCK_METHOD1(setDetectorID, void(int m_DetectorID));
  MOCK_CONST_METHOD0(getDetector, Geometry::IDetector_const_sptr());
  MOCK_CONST_METHOD0(getInstrument, Geometry::Instrument_const_sptr());
  MOCK_CONST_METHOD0(getRunNumber, int());
69
  MOCK_CONST_METHOD0(getPeakNumber, int());
70
  MOCK_CONST_METHOD0(getModulationVector, Mantid::Kernel::V3D());
71
  MOCK_METHOD1(setRunNumber, void(int m_RunNumber));
72
  MOCK_METHOD1(setPeakNumber, void(int m_PeakNumber));
73
  MOCK_METHOD1(setModulationVector, void(const Mantid::Kernel::V3D m_modStru));
74
75
76
77
78
79
  MOCK_CONST_METHOD0(getMonitorCount, double());
  MOCK_METHOD1(setMonitorCount, void(double m_MonitorCount));
  MOCK_CONST_METHOD0(getH, double());
  MOCK_CONST_METHOD0(getK, double());
  MOCK_CONST_METHOD0(getL, double());
  MOCK_CONST_METHOD0(getHKL, Mantid::Kernel::V3D());
Lynch, Vickie's avatar
Lynch, Vickie committed
80
  MOCK_CONST_METHOD0(getIntHKL, Mantid::Kernel::V3D());
81
82
83
84
  MOCK_METHOD1(setH, void(double m_H));
  MOCK_METHOD1(setK, void(double m_K));
  MOCK_METHOD1(setL, void(double m_L));
  MOCK_METHOD3(setHKL, void(double H, double K, double L));
Hahn, Steven's avatar
Hahn, Steven committed
85
  MOCK_METHOD1(setHKL, void(const Mantid::Kernel::V3D &HKL));
Lynch, Vickie's avatar
Lynch, Vickie committed
86
  MOCK_METHOD1(setIntHKL, void(const Mantid::Kernel::V3D &HKL));
87
88
89
  MOCK_CONST_METHOD0(getQLabFrame, Mantid::Kernel::V3D());
  MOCK_CONST_METHOD0(getQSampleFrame, Mantid::Kernel::V3D());
  MOCK_METHOD0(findDetector, bool());
90
91
  MOCK_METHOD1(findDetector,
               bool(const Mantid::Geometry::InstrumentRayTracer &tracer));
Hahn, Steven's avatar
Hahn, Steven committed
92
  MOCK_METHOD2(setQSampleFrame, void(const Mantid::Kernel::V3D &QSampleFrame,
93
                                     boost::optional<double> detectorDistance));
Hahn, Steven's avatar
Hahn, Steven committed
94
  MOCK_METHOD2(setQLabFrame, void(const Mantid::Kernel::V3D &QLabFrame,
95
96
97
98
                                  boost::optional<double> detectorDistance));
  MOCK_METHOD1(setWavelength, void(double wavelength));
  MOCK_CONST_METHOD0(getWavelength, double());
  MOCK_CONST_METHOD0(getScattering, double());
Lynch, Vickie's avatar
Lynch, Vickie committed
99
  MOCK_CONST_METHOD0(getAzimuthal, double());
100
101
102
103
  MOCK_CONST_METHOD0(getDSpacing, double());
  MOCK_CONST_METHOD0(getTOF, double());
  MOCK_CONST_METHOD0(getInitialEnergy, double());
  MOCK_CONST_METHOD0(getFinalEnergy, double());
Samuel Jackson's avatar
Samuel Jackson committed
104
  MOCK_CONST_METHOD0(getEnergyTransfer, double());
105
106
107
108
  MOCK_METHOD1(setInitialEnergy, void(double m_InitialEnergy));
  MOCK_METHOD1(setFinalEnergy, void(double m_FinalEnergy));
  MOCK_CONST_METHOD0(getIntensity, double());
  MOCK_CONST_METHOD0(getSigmaIntensity, double());
109
  MOCK_CONST_METHOD0(getIntensityOverSigma, double());
110
111
112
113
114
115
  MOCK_METHOD1(setIntensity, void(double m_Intensity));
  MOCK_METHOD1(setSigmaIntensity, void(double m_SigmaIntensity));
  MOCK_CONST_METHOD0(getBinCount, double());
  MOCK_METHOD1(setBinCount, void(double m_BinCount));
  MOCK_CONST_METHOD0(getGoniometerMatrix, Mantid::Kernel::Matrix<double>());
  MOCK_METHOD1(setGoniometerMatrix,
Hahn, Steven's avatar
Hahn, Steven committed
116
               void(const Mantid::Kernel::Matrix<double> &m_GoniometerMatrix));
117
118
119
120
121
122
123
124
125
126
  MOCK_CONST_METHOD0(getBankName, std::string());
  MOCK_CONST_METHOD0(getRow, int());
  MOCK_CONST_METHOD0(getCol, int());
  MOCK_CONST_METHOD0(getDetPos, Mantid::Kernel::V3D());
  MOCK_CONST_METHOD0(getL1, double());
  MOCK_CONST_METHOD0(getL2, double());
  MOCK_CONST_METHOD0(getDetectorPosition, Mantid::Kernel::V3D());
  MOCK_CONST_METHOD0(getDetectorPositionNoCheck, Mantid::Kernel::V3D());
  MOCK_CONST_METHOD0(getPeakShape, const Mantid::Geometry::PeakShape &());
};
127
}
128
GCC_DIAG_ON_SUGGEST_OVERRIDE
Owen Arnold's avatar
Owen Arnold committed
129
#endif /* MANTIDGEOMETRYTEST_MOCKOBJECTS_H_ */