BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
externalproperty.test.cpp File Reference

Implements class CLASS? More...

Include dependency graph for externalproperty.test.cpp:

Go to the source code of this file.

Classes

class  ExternalPropertyTest
 

Functions

 TEST_F (ExternalPropertyTest, constructor)
 
 TEST_F (ExternalPropertyTest, equalityOperators)
 
 TEST_F (ExternalPropertyTest, initialState)
 
 TEST_F (ExternalPropertyTest, variantEquality)
 

Detailed Description

Implements class CLASS?

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file externalproperty.test.cpp.

Function Documentation

◆ TEST_F() [1/4]

TEST_F ( ExternalPropertyTest  ,
constructor   
)

Definition at line 37 of file externalproperty.test.cpp.

38 {
39  ExternalProperty property("text", QColor(Qt::red), "123");
40  EXPECT_TRUE(property.isValid());
41  EXPECT_EQ(property.text(), "text");
42  EXPECT_EQ(property.color(), QColor("red"));
43  EXPECT_EQ(property.identifier(), "123");
44 }
Property to carry text, color and identifier.

References ModelView::ExternalProperty::color(), ModelView::ExternalProperty::identifier(), ModelView::ExternalProperty::isValid(), and ModelView::ExternalProperty::text().

Here is the call graph for this function:

◆ TEST_F() [2/4]

TEST_F ( ExternalPropertyTest  ,
equalityOperators   
)

Definition at line 46 of file externalproperty.test.cpp.

47 {
48  ExternalProperty prop1a;
49  ExternalProperty prop1b;
50 
51  EXPECT_TRUE(prop1a == prop1b);
52  EXPECT_FALSE(prop1a < prop1b);
53 
54  ExternalProperty prop2a("text", QColor(Qt::red));
55  ExternalProperty prop2b("text", QColor(Qt::red));
56  EXPECT_TRUE(prop2a == prop2b);
57  EXPECT_FALSE(prop2a < prop2b);
58 
59  EXPECT_FALSE(prop1a == prop2a);
60 }

◆ TEST_F() [3/4]

TEST_F ( ExternalPropertyTest  ,
initialState   
)

Definition at line 28 of file externalproperty.test.cpp.

29 {
30  ExternalProperty property;
31  EXPECT_FALSE(property.isValid());
32  EXPECT_EQ(property.text(), "");
33  EXPECT_EQ(property.identifier(), "");
34  EXPECT_FALSE(property.color().isValid());
35 }
std::string identifier() const

References ModelView::ExternalProperty::color(), ModelView::ExternalProperty::identifier(), ModelView::ExternalProperty::isValid(), and ModelView::ExternalProperty::text().

Here is the call graph for this function:

◆ TEST_F() [4/4]

TEST_F ( ExternalPropertyTest  ,
variantEquality   
)

Definition at line 62 of file externalproperty.test.cpp.

63 {
64  if (Comparators::registered()) {
65  ExternalProperty prop1a;
66  ExternalProperty prop1b;
67  EXPECT_TRUE(QVariant::fromValue(prop1a) == QVariant::fromValue(prop1b));
68 
69  ExternalProperty prop2a("text", QColor(Qt::red));
70  ExternalProperty prop2b("text", QColor(Qt::red));
71  EXPECT_TRUE(QVariant::fromValue(prop2a) == QVariant::fromValue(prop2b));
72 
73  EXPECT_FALSE(QVariant::fromValue(prop1a) == QVariant::fromValue(prop2a));
74  }
75 }

References ModelView::Comparators::registered().

Here is the call graph for this function: