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

Function TEST_F

src/model/test/EnergyManagementSystemActuator_GTest.cpp:44–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42using std::string;
43
44TEST_F(ModelFixture, EMSActuator_EMSActuator) {
45 Model model;
46
47 Building building = model.getUniqueModelObject<Building>();
48
49 ThermalZone zone1(model);
50 ThermalZone zone2(model);
51
52 // add fan
53 Schedule s = model.alwaysOnDiscreteSchedule();
54 FanConstantVolume fan(model, s);
55 FanConstantVolume fan2(model, s);
56
57 // add actuator
58 std::string fanControlType = "Fan Pressure Rise";
59 std::string ComponentType = "Fan";
60 EnergyManagementSystemActuator fanActuator(fan, ComponentType, fanControlType);
61 EXPECT_EQ(fanControlType, fanActuator.actuatedComponentControlType());
62 EXPECT_EQ(ComponentType, fanActuator.actuatedComponentType());
63
64 std::string fanName = fan.name().get() + "Press Actuator";
65 fanActuator.setName(fanName);
66
67 fanActuator.setActuatedComponentControlType(fanControlType);
68
69 EXPECT_EQ(fan, fanActuator.actuatedComponent().get());
70 EXPECT_EQ(fanControlType, fanActuator.actuatedComponentControlType());
71
72 fanActuator.setActuatedComponentType(ComponentType);
73 EXPECT_EQ(ComponentType, fanActuator.actuatedComponentType());
74
75 fanActuator.setActuatedComponent(fan2);
76 EXPECT_EQ(fan2, fanActuator.actuatedComponent().get());
77
78 //add electric equipment actuator
79 ElectricEquipmentDefinition definition(model);
80 ElectricEquipment electricEquipment(definition);
81 ComponentType = "ElectricEquipment";
82 std::string equipControlType = "Electricity Rate";
83 EnergyManagementSystemActuator equipActuator(electricEquipment, ComponentType, equipControlType);
84 EXPECT_EQ(equipControlType, equipActuator.actuatedComponentControlType());
85 EXPECT_EQ(ComponentType, equipActuator.actuatedComponentType());
86
87 std::string equipName = electricEquipment.name().get() + "power level Actuator";
88 equipActuator.setName(equipName);
89
90 equipActuator.setActuatedComponentControlType(equipControlType);
91
92 EXPECT_EQ(electricEquipment, equipActuator.actuatedComponent().get());
93 EXPECT_EQ(equipControlType, equipActuator.actuatedComponentControlType());
94
95 equipActuator.setActuatedComponentType(ComponentType);
96 EXPECT_EQ(ComponentType, equipActuator.actuatedComponentType());
97}
98
99TEST_F(ModelFixture, EMSActuator_newEMSActuator) {
100 Model model;

Callers

nothing calls this directly

Calls 15

actuatedComponentMethod · 0.80
setActuatedComponentMethod · 0.80
actuatedComponentTypeMethod · 0.45
getMethod · 0.45
nameMethod · 0.45
setNameMethod · 0.45

Tested by

no test coverage detected