BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
itemmanager.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/testmodel/itemmanager.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 "mvvm/model/itemmanager.h"
17 #include "mvvm/model/itempool.h"
18 #include "mvvm/model/sessionitem.h"
20 #include <memory>
21 
22 using namespace ModelView;
23 
24 //! Testing ItemFactory in the context of SessionModel and unique identifiers of SessionItem.
25 
26 class ItemManagerTest : public ::testing::Test {
27 public:
29 };
30 
32 
33 TEST_F(ItemManagerTest, initialState)
34 {
35  ItemManager manager;
36  EXPECT_EQ(manager.itemPool(), nullptr);
37 
38  std::shared_ptr<ItemPool> pool(new ItemPool);
39  manager.setItemPool(pool);
40  EXPECT_EQ(manager.itemPool(), pool.get());
41  EXPECT_EQ(manager.itemPool()->size(), 0);
42 }
Testing ItemFactory in the context of SessionModel and unique identifiers of SessionItem.
Manages item creation/registration for SessionModel.
Definition: itemmanager.h:30
void setItemPool(std::shared_ptr< ItemPool > pool)
Definition: itemmanager.cpp:37
const ItemPool * itemPool() const
Definition: itemmanager.cpp:64
Provides registration of SessionItem pointers and their unique identifiers in global memory pool.
Definition: itempool.h:29
size_t size() const
Definition: itempool.cpp:21
Defines class CLASS?
Defines class CLASS?
TEST_F(ItemManagerTest, initialState)
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
Defines class CLASS?
Defines class CLASS?