BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
toyitemslattice.test.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/tests/testintegration/toyitemslattice.test.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #include "google_test.h"
16 #include "toyitems.h"
17 #include "toymodel.h"
18 
19 using namespace ModelView;
20 using namespace ToyItems;
21 
22 //! Test toy LatticeItem.
23 
24 class ToyItemsLatticeTest : public ::testing::Test {
25 public:
27 };
28 
30 
31 //! Business logice (enabled/disabled).
32 
34 {
36  auto lattice = model.insertItem<LatticeItem>();
37 
38  // by default integration flag is ON, rotation angle is disabled
39  EXPECT_TRUE(lattice->property<bool>(LatticeItem::P_INTEGRATION));
40  EXPECT_FALSE(lattice->getItem(LatticeItem::P_ROTATION_ANLE)->isEnabled());
41 
42  // switching integration OFF, checking that rotation is enabled
43  lattice->setProperty(LatticeItem::P_INTEGRATION, false);
44  EXPECT_TRUE(lattice->getItem(LatticeItem::P_ROTATION_ANLE)->isEnabled());
45 }
T * insertItem(SessionItem *parent=nullptr, const TagRow &tagrow={})
Inserts item into given parent under given tagrow.
Definition: sessionmodel.h:104
Test toy LatticeItem.
Represents a lattice.
Definition: toyitems.h:72
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
Collection of toy items and models for testing purposes.
Definition: toyitems.h:26
Defines class CLASS?
TEST_F(ToyItemsLatticeTest, ToyItemsLatticeTest)
Business logice (enabled/disabled).
Defines class CLASS?