Skip to content

Commit

Permalink
Improve and fixup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Jan 9, 2025
1 parent 25ff3d2 commit f753db8
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/model/test/ZoneHVACEvaporativeCoolerUnit_GTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,27 @@ TEST_F(ModelFixture, ZoneHVACEvaporativeCoolerUnit_remove) {
Model m;
ZoneHVACEvaporativeCoolerUnit zonehvac(m);

auto fanComponent = zonehvac.supplyAirFan();
ASSERT_TRUE(fanComponent.optionalCast<FanComponentModel>());
EXPECT_TRUE(fanComponent.containingZoneHVACComponent());
EXPECT_EQ(zonehvac.handle(), fanComponent.containingZoneHVACComponent().get().handle());
EXPECT_FALSE(fanComponent.isRemovable());

auto evapCoolerComponent = zonehvac.firstEvaporativeCooler();
ASSERT_TRUE(evapCoolerComponent.optionalCast<EvaporativeCoolerDirectResearchSpecial>());
EXPECT_TRUE(evapCoolerComponent.containingZoneHVACComponent());
EXPECT_EQ(zonehvac.handle(), evapCoolerComponent.containingZoneHVACComponent().get().handle());
EXPECT_FALSE(evapCoolerComponent.isRemovable());

auto size = m.modelObjects().size();
EXPECT_EQ(1, m.getConcreteModelObjects<ZoneHVACEvaporativeCoolerUnit>().size());
EXPECT_EQ(1, m.getConcreteModelObjects<FanComponentModel>().size());
EXPECT_EQ(1, m.getConcreteModelObjects<EvaporativeCoolerDirectResearchSpecial>().size());
EXPECT_EQ(0, m.getConcreteModelObjects<EvaporativeCoolerIndirectResearchSpecial>().size());
EXPECT_EQ(1, m.getConcreteModelObjects<ScheduleConstant>().size());
// remove returns: ["Zone HVAC Evaporative Cooler Unit 1", "Fan Component Model 1", "Evaporative Cooler Direct Research Special 1"]
EXPECT_FALSE(zonehvac.remove().empty());
EXPECT_EQ(size - 1, m.modelObjects().size());
EXPECT_EQ(size - 3, m.modelObjects().size());
EXPECT_EQ(0, m.getConcreteModelObjects<ZoneHVACEvaporativeCoolerUnit>().size());
EXPECT_EQ(0, m.getConcreteModelObjects<FanComponentModel>().size());
EXPECT_EQ(0, m.getConcreteModelObjects<EvaporativeCoolerDirectResearchSpecial>().size());
Expand Down

0 comments on commit f753db8

Please sign in to comment.