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
#ifndef MASKEDPROPERTYTEST_H_
#define MASKEDPROPERTYTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidKernel/PropertyWithValue.h"
#include "MantidKernel/MaskedProperty.h"
using namespace Mantid::Kernel;
class MaskedPropertyTest:public CxxTest::TestSuite
{
public:
MaskedPropertyTest()
{
m_Property1=new MaskedProperty<std::string>("property1","value");
m_Property2= new MaskedProperty<std::string>("property2","");
}
void testMaskProperty()
{
TS_ASSERT(! m_Property1->name().compare("property1") );
TS_ASSERT(! m_Property1->value().compare("value") );
PropertyHistory prohist=m_Property1->createHistory();
TS_ASSERT(! prohist.value().compare("*****") );
}
void testMaskProperty1()
{
TS_ASSERT(! m_Property2->name().compare("property2") );
TS_ASSERT(! m_Property2->value().compare("") );
PropertyHistory prohist=m_Property2->createHistory();
TS_ASSERT(! prohist.value().compare("") );
}
~MaskedPropertyTest()
{
delete m_Property1;
}
private:
MaskedProperty<std::string> *m_Property1;
MaskedProperty<std::string> *m_Property2;
};