forked from npshub/mantid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InvisiblePropertyTest.h
40 lines (31 loc) · 1.25 KB
/
InvisiblePropertyTest.h
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
// 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 & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#pragma once
#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;
};