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

Function TEST_F

src/energyplus/Test/OutputControlTableStyle_GTest.cpp:28–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26using namespace openstudio;
27
28TEST_F(EnergyPlusFixture, ForwardTranslator_OutputControlTableStyle) {
29
30 // Not there, but workspace should have it
31 {
32 Model m;
33 ForwardTranslator ft;
34 Workspace w = ft.translateModel(m);
35
36 WorkspaceObjectVector idfObjs = w.getObjectsByType(IddObjectType::OutputControl_Table_Style);
37 ASSERT_EQ(1u, idfObjs.size());
38
39 WorkspaceObject idf_tablestyle = idfObjs[0];
40
41 EXPECT_EQ("HTML", idf_tablestyle.getString(OutputControl_Table_StyleFields::ColumnSeparator, false).get());
42 EXPECT_TRUE(idf_tablestyle.isEmpty(OutputControl_Table_StyleFields::UnitConversion));
43 }
44
45 // Not there, m_ipTabularOutput = True
46 {
47 Model m;
48 ForwardTranslator ft;
49 ft.setIPTabularOutput(true);
50 Workspace w = ft.translateModel(m);
51
52 WorkspaceObjectVector idfObjs = w.getObjectsByType(IddObjectType::OutputControl_Table_Style);
53 ASSERT_EQ(1u, idfObjs.size());
54
55 WorkspaceObject idf_tablestyle = idfObjs[0];
56
57 EXPECT_EQ("HTML", idf_tablestyle.getString(OutputControl_Table_StyleFields::ColumnSeparator, false).get());
58 EXPECT_EQ("InchPound", idf_tablestyle.getString(OutputControl_Table_StyleFields::UnitConversion, false).get());
59 }
60
61 // Not there, m_forwardTranslatorOptions.excludeHTMLOutputReport() = True
62 {
63 Model m;
64 ForwardTranslator ft;
65 ft.setExcludeHTMLOutputReport(true);
66 Workspace w = ft.translateModel(m);
67
68 WorkspaceObjectVector idfObjs = w.getObjectsByType(IddObjectType::OutputControl_Table_Style);
69 ASSERT_EQ(0u, idfObjs.size());
70 }
71
72 // It's already in the model
73 {
74 Model m;
75 ForwardTranslator ft;
76
77 OutputControlTableStyle outputControlTableStyle = m.getUniqueModelObject<OutputControlTableStyle>();
78
79 EXPECT_TRUE(outputControlTableStyle.setColumnSeparator("Tab"));
80 EXPECT_TRUE(outputControlTableStyle.setUnitConversion("JtoKWH"));
81
82 Workspace w = ft.translateModel(m);
83
84 WorkspaceObjectVector idfObjs = w.getObjectsByType(IddObjectType::OutputControl_Table_Style);
85 ASSERT_EQ(1u, idfObjs.size());

Callers

nothing calls this directly

Calls 15

setUnitConversionMethod · 0.80
translateWorkspaceMethod · 0.80
unitConversionMethod · 0.80
IdfObjectClass · 0.50
translateModelMethod · 0.45
getObjectsByTypeMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
getStringMethod · 0.45
isEmptyMethod · 0.45
setIPTabularOutputMethod · 0.45

Tested by

no test coverage detected