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

Implements class CLASS? More...

Include dependency graph for groupitem.test.cpp:

Go to the source code of this file.

Classes

class  GroupItemTest
 Testing GroupItem class. More...
 

Functions

 TEST_F (GroupItemTest, initialState)
 

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 groupitem.test.cpp.

Function Documentation

◆ TEST_F()

TEST_F ( GroupItemTest  ,
initialState   
)

Definition at line 30 of file groupitem.test.cpp.

31 {
32  GroupItem item;
33  EXPECT_EQ(item.currentIndex(), -1);
34  EXPECT_EQ(item.currentItem(), nullptr);
35  EXPECT_EQ(item.currentType(), "");
36  EXPECT_TRUE(item.hasData());
37  EXPECT_TRUE(item.children().empty());
38  EXPECT_THROW(item.setCurrentType("abc"), std::runtime_error);
39 }
Group item holds collection of predefined items.
Definition: groupitem.h:26
const SessionItem * currentItem() const
Returns currently selected item.
Definition: groupitem.cpp:41
void setCurrentType(const std::string &model_type)
Sets item corresponding to given model type.
Definition: groupitem.cpp:58
std::string currentType() const
Definition: groupitem.cpp:51
int currentIndex() const
Definition: groupitem.cpp:34
bool hasData(int role=ItemDataRole::DATA) const
Returns true if item has data on board with given role.
std::vector< SessionItem * > children() const
Returns vector of children formed from all chidlren from all tags.

References ModelView::SessionItem::children(), ModelView::GroupItem::currentIndex(), ModelView::GroupItem::currentItem(), ModelView::GroupItem::currentType(), ModelView::SessionItem::hasData(), and ModelView::GroupItem::setCurrentType().

Here is the call graph for this function: