| 22 | using namespace openstudio::model; |
| 23 | |
| 24 | TEST_F(ModelFixture, PipeIndoor_GettersSetters) { |
| 25 | Model m; |
| 26 | |
| 27 | PipeIndoor pipeIndoor(m); |
| 28 | pipeIndoor.setName("My PipeIndoor"); |
| 29 | |
| 30 | // Construction: Optional Object |
| 31 | StandardOpaqueMaterial mat(m, "Smooth", 3.00E-03, 45.31, 7833.0, 500.0); |
| 32 | EXPECT_TRUE(mat.setThermalAbsorptance(0.9)); |
| 33 | EXPECT_TRUE(mat.setSolarAbsorptance(0.5)); |
| 34 | EXPECT_TRUE(mat.setVisibleAbsorptance(0.5)); |
| 35 | Construction c(m); |
| 36 | EXPECT_TRUE(c.insertLayer(0, mat)); |
| 37 | EXPECT_TRUE(pipeIndoor.setConstruction(c)); |
| 38 | ASSERT_TRUE(pipeIndoor.construction()); |
| 39 | EXPECT_EQ(c, pipeIndoor.construction().get()); |
| 40 | |
| 41 | // Environment Type: Required String |
| 42 | EXPECT_TRUE(pipeIndoor.setEnvironmentType("Zone")); |
| 43 | EXPECT_EQ("Zone", pipeIndoor.environmentType()); |
| 44 | // Bad Value |
| 45 | EXPECT_FALSE(pipeIndoor.setEnvironmentType("BADENUM")); |
| 46 | EXPECT_EQ("Zone", pipeIndoor.environmentType()); |
| 47 | |
| 48 | // Ambient Temperature Zone: Optional Object |
| 49 | ThermalZone ambientTemperatureZone(m); |
| 50 | EXPECT_TRUE(pipeIndoor.setAmbientTemperatureZone(ambientTemperatureZone)); |
| 51 | ASSERT_TRUE(pipeIndoor.ambientTemperatureZone()); |
| 52 | EXPECT_EQ(ambientTemperatureZone, pipeIndoor.ambientTemperatureZone().get()); |
| 53 | |
| 54 | // Ambient Temperature Schedule: Optional Object |
| 55 | ScheduleConstant ambientTemperatureSchedule(m); |
| 56 | EXPECT_TRUE(pipeIndoor.setAmbientTemperatureSchedule(ambientTemperatureSchedule)); |
| 57 | ASSERT_TRUE(pipeIndoor.ambientTemperatureSchedule()); |
| 58 | EXPECT_EQ(ambientTemperatureSchedule, pipeIndoor.ambientTemperatureSchedule().get()); |
| 59 | |
| 60 | // Ambient Air Velocity Schedule: Optional Object |
| 61 | ScheduleConstant ambientAirVelocitySchedule(m); |
| 62 | EXPECT_TRUE(pipeIndoor.setAmbientAirVelocitySchedule(ambientAirVelocitySchedule)); |
| 63 | ASSERT_TRUE(pipeIndoor.ambientAirVelocitySchedule()); |
| 64 | EXPECT_EQ(ambientAirVelocitySchedule, pipeIndoor.ambientAirVelocitySchedule().get()); |
| 65 | |
| 66 | // Pipe Inside Diameter: Required Double |
| 67 | EXPECT_TRUE(pipeIndoor.setPipeInsideDiameter(1.0)); |
| 68 | EXPECT_EQ(1.0, pipeIndoor.pipeInsideDiameter()); |
| 69 | // Bad Value |
| 70 | EXPECT_FALSE(pipeIndoor.setPipeInsideDiameter(-10.0)); |
| 71 | EXPECT_EQ(1.0, pipeIndoor.pipeInsideDiameter()); |
| 72 | |
| 73 | // Pipe Length: Required Double |
| 74 | EXPECT_TRUE(pipeIndoor.setPipeLength(50.0)); |
| 75 | EXPECT_EQ(50.0, pipeIndoor.pipeLength()); |
| 76 | // Bad Value |
| 77 | EXPECT_FALSE(pipeIndoor.setPipeLength(-10.0)); |
| 78 | EXPECT_EQ(50.0, pipeIndoor.pipeLength()); |
| 79 | } |
| 80 | |
| 81 | TEST_F(ModelFixture, PipeIndoor_addToNode) { |
nothing calls this directly
no test coverage detected