@@ -58,3 +58,150 @@ testthat::test_that(
5858 )
5959 }
6060)
61+
62+
63+
64+ testthat :: test_that(
65+ desc = " party_eic() works" ,
66+ code = {
67+ testthat :: expect_no_error(object = party_eic())
68+ testthat :: expect_error(
69+ object = party_eic(" foo" ),
70+ info = " Error in party_eic('foo') : unused argument ('foo')"
71+ )
72+ tbl <- party_eic()
73+ testthat :: expect_s3_class(object = tbl , class = " tbl_df" , exact = FALSE )
74+ testthat :: expect_gt(object = nrow(tbl ), expected = 0L )
75+ testthat :: expect_contains(
76+ object = names(tbl ),
77+ expected = c(" EicCode" , " EicLongName" , " type" )
78+ )
79+ testthat :: expect_true(object = all(tbl $ type == " X" ))
80+ }
81+ )
82+
83+
84+
85+ testthat :: test_that(
86+ desc = " area_eic() works" ,
87+ code = {
88+ testthat :: expect_no_error(object = area_eic())
89+ testthat :: expect_error(
90+ object = area_eic(" foo" ),
91+ info = " Error in area_eic('foo') : unused argument ('foo')"
92+ )
93+ tbl <- area_eic()
94+ testthat :: expect_s3_class(object = tbl , class = " tbl_df" , exact = FALSE )
95+ testthat :: expect_gt(object = nrow(tbl ), expected = 0L )
96+ testthat :: expect_contains(
97+ object = names(tbl ),
98+ expected = c(" EicCode" , " EicLongName" , " type" )
99+ )
100+ testthat :: expect_true(object = all(tbl $ type == " Y" ))
101+ }
102+ )
103+
104+
105+
106+ testthat :: test_that(
107+ desc = " accounting_point_eic() works" ,
108+ code = {
109+ testthat :: expect_no_error(object = accounting_point_eic())
110+ testthat :: expect_error(
111+ object = accounting_point_eic(" foo" ),
112+ info = " Error in accounting_point_eic('foo') : unused argument ('foo')"
113+ )
114+ tbl <- accounting_point_eic()
115+ testthat :: expect_s3_class(object = tbl , class = " tbl_df" , exact = FALSE )
116+ testthat :: expect_gt(object = nrow(tbl ), expected = 0L )
117+ testthat :: expect_contains(
118+ object = names(tbl ),
119+ expected = c(" EicCode" , " EicLongName" , " type" )
120+ )
121+ testthat :: expect_true(object = all(tbl $ type == " Z" ))
122+ }
123+ )
124+
125+
126+
127+ testthat :: test_that(
128+ desc = " tie_line_eic() works" ,
129+ code = {
130+ testthat :: expect_no_error(object = tie_line_eic())
131+ testthat :: expect_error(
132+ object = tie_line_eic(" foo" ),
133+ info = " Error in tie_line_eic('foo') : unused argument ('foo')"
134+ )
135+ tbl <- tie_line_eic()
136+ testthat :: expect_s3_class(object = tbl , class = " tbl_df" , exact = FALSE )
137+ testthat :: expect_gt(object = nrow(tbl ), expected = 0L )
138+ testthat :: expect_contains(
139+ object = names(tbl ),
140+ expected = c(" EicCode" , " EicLongName" , " type" )
141+ )
142+ testthat :: expect_true(object = all(tbl $ type == " T" ))
143+ }
144+ )
145+
146+
147+
148+ testthat :: test_that(
149+ desc = " location_eic() works" ,
150+ code = {
151+ testthat :: expect_no_error(object = location_eic())
152+ testthat :: expect_error(
153+ object = location_eic(" foo" ),
154+ info = " Error in location_eic('foo') : unused argument ('foo')"
155+ )
156+ tbl <- location_eic()
157+ testthat :: expect_s3_class(object = tbl , class = " tbl_df" , exact = FALSE )
158+ testthat :: expect_gt(object = nrow(tbl ), expected = 0L )
159+ testthat :: expect_contains(
160+ object = names(tbl ),
161+ expected = c(" EicCode" , " EicLongName" , " type" )
162+ )
163+ testthat :: expect_true(object = all(tbl $ type == " V" ))
164+ }
165+ )
166+
167+
168+
169+ testthat :: test_that(
170+ desc = " resource_object_eic() works" ,
171+ code = {
172+ testthat :: expect_no_error(object = resource_object_eic())
173+ testthat :: expect_error(
174+ object = resource_object_eic(" foo" ),
175+ info = " Error in resource_object_eic('foo') : unused argument ('foo')"
176+ )
177+ tbl <- resource_object_eic()
178+ testthat :: expect_s3_class(object = tbl , class = " tbl_df" , exact = FALSE )
179+ testthat :: expect_gt(object = nrow(tbl ), expected = 0L )
180+ testthat :: expect_contains(
181+ object = names(tbl ),
182+ expected = c(" EicCode" , " EicLongName" , " type" )
183+ )
184+ testthat :: expect_true(object = all(tbl $ type == " W" ))
185+ }
186+ )
187+
188+
189+
190+ testthat :: test_that(
191+ desc = " substation_eic() works" ,
192+ code = {
193+ testthat :: expect_no_error(object = substation_eic())
194+ testthat :: expect_error(
195+ object = substation_eic(" foo" ),
196+ info = " Error in substation_eic('foo') : unused argument ('foo')"
197+ )
198+ tbl <- substation_eic()
199+ testthat :: expect_s3_class(object = tbl , class = " tbl_df" , exact = FALSE )
200+ testthat :: expect_gt(object = nrow(tbl ), expected = 0L )
201+ testthat :: expect_contains(
202+ object = names(tbl ),
203+ expected = c(" EicCode" , " EicLongName" , " type" )
204+ )
205+ testthat :: expect_true(object = all(tbl $ type == " A" ))
206+ }
207+ )
0 commit comments