Newer
Older
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
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
#ifndef MANTID_KERNEL_INVISIBLEPROPERTYTEST_H_
#define MANTID_KERNEL_INVISIBLEPROPERTYTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidKernel/InvisibleProperty.h"
#include "MantidKernel/PropertyManagerOwner.h"
#include <memory>
using namespace Mantid::Kernel;
class InvisiblePropertyTest : public CxxTest::TestSuite {
public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static InvisiblePropertyTest *createSuite() {
return new InvisiblePropertyTest();
}
static void destroySuite(InvisiblePropertyTest *suite) { delete suite; }
void test_construct() { TS_ASSERT_THROWS_NOTHING(InvisibleProperty{}); }
void test_isVisible() {
InvisibleProperty prop;
TS_ASSERT(!prop.isVisible(&m_owner));
}
void test_clone() {
InvisibleProperty prop;
std::unique_ptr<IPropertySettings> clone(prop.clone());
TS_ASSERT(!clone->isVisible(&m_owner));
}
private:
const PropertyManagerOwner m_owner;
};
#endif /* MANTID_KERNEL_INVISIBLEPROPERTYTEST_H_ */