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

Function TEST_F

src/model/test/DaylightingDeviceLightWell_GTest.cpp:19–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17using namespace openstudio;
18
19TEST_F(ModelFixture, DaylightingDeviceLightWell) {
20 Model model;
21
22 Point3dVector points{
23 {0, 0, 1},
24 {0, 0, 0},
25 {0, 1, 0},
26 {0, 1, 1},
27 };
28 SubSurface window(points, model);
29 EXPECT_EQ("FixedWindow", window.subSurfaceType());
30
31 EXPECT_FALSE(window.daylightingDeviceLightWell());
32
33 EXPECT_EQ(0u, model.getConcreteModelObjects<DaylightingDeviceLightWell>().size());
34 DaylightingDeviceLightWell lightWell(window, 1, 2, 3, 0.75);
35 UUID lightWellHandle = lightWell.handle();
36 ASSERT_TRUE(window.daylightingDeviceLightWell());
37 EXPECT_EQ(lightWellHandle, window.daylightingDeviceLightWell()->handle());
38 ASSERT_TRUE(window.addDaylightingDeviceLightWell());
39 EXPECT_EQ(lightWellHandle, window.addDaylightingDeviceLightWell()->handle());
40 EXPECT_EQ(window.addDaylightingDeviceLightWell()->handle(), window.daylightingDeviceLightWell()->handle());
41 EXPECT_EQ(window.handle(), lightWell.subSurface().handle());
42 EXPECT_EQ(1u, model.getConcreteModelObjects<DaylightingDeviceLightWell>().size());
43
44 lightWell.remove();
45 EXPECT_EQ(0u, model.getConcreteModelObjects<DaylightingDeviceLightWell>().size());
46
47 EXPECT_FALSE(window.daylightingDeviceLightWell());
48 ASSERT_TRUE(window.addDaylightingDeviceLightWell());
49 lightWellHandle = window.addDaylightingDeviceLightWell()->handle();
50 EXPECT_EQ(1u, model.getConcreteModelObjects<DaylightingDeviceLightWell>().size());
51 // Calling it a second time while a Light Well already exists returns the existing one, doesn't create a second
52 ASSERT_TRUE(window.addDaylightingDeviceLightWell());
53 EXPECT_EQ(lightWellHandle, window.addDaylightingDeviceLightWell()->handle());
54 EXPECT_EQ(1u, model.getConcreteModelObjects<DaylightingDeviceLightWell>().size());
55
56 ASSERT_TRUE(window.addDaylightingDeviceLightWell());
57 EXPECT_EQ(lightWellHandle, window.addDaylightingDeviceLightWell()->handle());
58 ASSERT_TRUE(window.daylightingDeviceLightWell());
59 EXPECT_EQ(lightWellHandle, window.daylightingDeviceLightWell()->handle());
60
61 // changing to door removes light light well
62 EXPECT_TRUE(window.setSubSurfaceType("Door"));
63 EXPECT_EQ("Door", window.subSurfaceType());
64 EXPECT_FALSE(window.daylightingDeviceLightWell());
65 EXPECT_FALSE(window.addDaylightingDeviceLightWell());
66 EXPECT_EQ(0u, model.getConcreteModelObjects<DaylightingDeviceLightWell>().size());
67}
68
69TEST_F(ModelFixture, DaylightingDeviceLightWell_Throw) {
70 Model model;

Callers

nothing calls this directly

Calls 15

subSurfaceTypeMethod · 0.80
setSubSurfaceTypeMethod · 0.80
heightofWellMethod · 0.80
areaofBottomofWellMethod · 0.80
setHeightofWellMethod · 0.80
setAreaofBottomofWellMethod · 0.80

Tested by

no test coverage detected