BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
viewmodelcontrollerfactory.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/testviewmodel/viewmodelcontrollerfactory.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"
22 
23 using namespace ModelView;
24 
25 //! Tests of ViewModelControllerFactory method.
26 
27 class ViewModelControllerFactoryTest : public ::testing::Test {
28 public:
30 };
31 
33 
34 TEST_F(ViewModelControllerFactoryTest, allItemsControllerBuild)
35 {
36  SessionModel session_model;
37  ViewModelBase view_model;
38 
39  auto controller = Factory::CreateController<AllChildrenStrategy, LabelDataRowStrategy>(
40  &session_model, &view_model);
41 
42  controller->setRootSessionItem(session_model.rootItem());
43 
44  EXPECT_EQ(controller->sessionModel(), &session_model);
45  EXPECT_EQ(controller->rootSessionItem(), session_model.rootItem());
46  EXPECT_EQ(view_model.columnCount(), 0);
47  EXPECT_EQ(view_model.rowCount(), 0);
48 }
Main class to hold hierarchy of SessionItem objects.
Definition: sessionmodel.h:37
SessionItem * rootItem() const
Returns root item of the model.
Base class for all view models to show content of SessionModel in Qt views.
Definition: viewmodelbase.h:31
int rowCount(const QModelIndex &parent=QModelIndex()) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Tests of ViewModelControllerFactory method.
Defines class CLASS?
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
TEST_F(ViewModelControllerFactoryTest, allItemsControllerBuild)