MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / TEST_F

Function TEST_F

src/model/test/PythonPluginOutputVariable_GTest.cpp:14–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace openstudio::model;
13
14TEST_F(ModelFixture, PythonPluginOutputVariable_GettersSetters) {
15 Model m;
16
17 PythonPluginVariable pyVar(m);
18 PythonPluginOutputVariable pythonPluginOutputVariable(pyVar);
19 EXPECT_EQ(pyVar, pythonPluginOutputVariable.pythonPluginVariable());
20 EXPECT_EQ(1, pyVar.pythonPluginOutputVariables().size());
21
22 pythonPluginOutputVariable.setName("My PythonPluginOutputVariable");
23
24 // Python Plugin Variable Name: Required Object
25 PythonPluginVariable pyVar2(m);
26 EXPECT_TRUE(pythonPluginOutputVariable.setPythonPluginVariable(pyVar2));
27 EXPECT_EQ(pyVar2, pythonPluginOutputVariable.pythonPluginVariable());
28
29 // Type of Data in Variable: Required String
30 EXPECT_TRUE(pythonPluginOutputVariable.setTypeofDatainVariable("Averaged"));
31 EXPECT_EQ("Averaged", pythonPluginOutputVariable.typeofDatainVariable());
32 // Bad Value
33 EXPECT_FALSE(pythonPluginOutputVariable.setTypeofDatainVariable("BADENUM"));
34 EXPECT_EQ("Averaged", pythonPluginOutputVariable.typeofDatainVariable());
35
36 // Update Frequency: Required String
37 EXPECT_TRUE(pythonPluginOutputVariable.setUpdateFrequency("ZoneTimestep"));
38 EXPECT_EQ("ZoneTimestep", pythonPluginOutputVariable.updateFrequency());
39 // Bad Value
40 EXPECT_FALSE(pythonPluginOutputVariable.setUpdateFrequency("BADENUM"));
41 EXPECT_EQ("ZoneTimestep", pythonPluginOutputVariable.updateFrequency());
42
43 // Units: Optional String
44 EXPECT_TRUE(pythonPluginOutputVariable.setUnits("C"));
45 ASSERT_TRUE(pythonPluginOutputVariable.units());
46 EXPECT_EQ("C", pythonPluginOutputVariable.units().get());
47
48 // Resource Type: Optional String
49 EXPECT_TRUE(pythonPluginOutputVariable.setResourceType("Electricity"));
50 ASSERT_TRUE(pythonPluginOutputVariable.resourceType());
51 EXPECT_EQ("Electricity", pythonPluginOutputVariable.resourceType().get());
52 // Bad Value
53 EXPECT_FALSE(pythonPluginOutputVariable.setResourceType("BADENUM"));
54 ASSERT_TRUE(pythonPluginOutputVariable.resourceType());
55 EXPECT_EQ("Electricity", pythonPluginOutputVariable.resourceType().get());
56
57 // Group Type: Optional String
58 EXPECT_TRUE(pythonPluginOutputVariable.setGroupType("Building"));
59 ASSERT_TRUE(pythonPluginOutputVariable.groupType());
60 EXPECT_EQ("Building", pythonPluginOutputVariable.groupType().get());
61 // Bad Value
62 EXPECT_FALSE(pythonPluginOutputVariable.setGroupType("BADENUM"));
63 ASSERT_TRUE(pythonPluginOutputVariable.groupType());
64 EXPECT_EQ("Building", pythonPluginOutputVariable.groupType().get());
65
66 // End-Use Category: Optional String
67 EXPECT_TRUE(pythonPluginOutputVariable.setEndUseCategory("Heating"));
68 ASSERT_TRUE(pythonPluginOutputVariable.endUseCategory());
69 EXPECT_EQ("Heating", pythonPluginOutputVariable.endUseCategory().get());
70 // Bad Value
71 EXPECT_FALSE(pythonPluginOutputVariable.setEndUseCategory("BADENUM"));

Callers

nothing calls this directly

Calls 15

typeofDatainVariableMethod · 0.80
pythonPluginVariableMethod · 0.45
sizeMethod · 0.45
setNameMethod · 0.45
setUpdateFrequencyMethod · 0.45
updateFrequencyMethod · 0.45
setUnitsMethod · 0.45
unitsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected