Skip to content
Permalink
Browse files

Merge pull request #13487 from andrsd/add-unit-test

Adding a unit test
  • Loading branch information...
aeslaughter committed May 31, 2019
2 parents 7d14981 + 48e45fa commit d284469f292b0beb9e9927294c23111047b15d5d
Showing with 17 additions and 1 deletion.
  1. +1 −1 framework/include/utils/InputParameterWarehouse.h
  2. +16 −0 unit/src/InputParameterWarehouseTest.C
@@ -178,6 +178,7 @@ class InputParameterWarehouse
FRIEND_TEST(InputParameterWarehouse, getControllableItems);
FRIEND_TEST(InputParameterWarehouse, getControllableParameter);
FRIEND_TEST(InputParameterWarehouse, getControllableParameterValues);
FRIEND_TEST(InputParameterWarehouse, emptyControllableParameterValues);
FRIEND_TEST(InputParameterWarehouse, addControllableParameterConnection);
FRIEND_TEST(InputParameterWarehouse, addControllableParameterAlias);
};
@@ -190,4 +191,3 @@ InputParameterWarehouse::getControllableParameterValues(
ControllableParameter param = getControllableParameter(input);
return param.get<T>();
}

@@ -114,6 +114,22 @@ TEST(InputParameterWarehouse, getControllableParameterValues)
EXPECT_EQ(values, std::vector<int>(1, 2011));
}

TEST(InputParameterWarehouse, emptyControllableParameterValues)
{
InputParameters in_params = emptyInputParameters();
in_params.addPrivateParam<std::string>("_moose_base", "Base");
in_params.addParam<int>("control", 2011, "");
in_params.declareControllable("control");

InputParameterWarehouse wh;
wh.addInputParameters("Object", in_params);

MooseObjectParameterName name("Base", "Object", "asdf");
std::vector<int> values = wh.getControllableParameterValues<int>(name);

ASSERT_TRUE(values.empty());
}

TEST(InputParameterWarehouse, addControllableParameterConnection)
{
// One-to-one

0 comments on commit d284469

Please sign in to comment.
You can’t perform that action at this time.