Skip to content

Commit ce40c44

Browse files
committed
unit tests further improved
1 parent 1caeef0 commit ce40c44

File tree

8 files changed

+3677
-1168
lines changed

8 files changed

+3677
-1168
lines changed

tests/testthat/test-en_balancing.R

Lines changed: 1204 additions & 360 deletions
Large diffs are not rendered by default.

tests/testthat/test-en_generation.R

Lines changed: 429 additions & 144 deletions
Large diffs are not rendered by default.

tests/testthat/test-en_helpers.R

Lines changed: 75 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
testthat::test_that(
2+
desc = "all_approved_eic() validates inputs",
3+
code = {
4+
testthat::expect_error(
5+
object = all_approved_eic("foo"),
6+
regexp = 'unused argument \\("foo"\\)'
7+
)
8+
}
9+
)
10+
11+
112
testthat::test_that(
213
desc = "all_approved_eic() works",
314
code = {
@@ -21,8 +32,15 @@ testthat::test_that(
2132
object = names(tbl),
2233
expected = c("EicCode", "EicLongName")
2334
)
35+
}
36+
)
37+
38+
39+
testthat::test_that(
40+
desc = "party_eic() validates inputs",
41+
code = {
2442
testthat::expect_error(
25-
object = all_approved_eic("foo"),
43+
object = party_eic("foo"),
2644
regexp = 'unused argument \\("foo"\\)'
2745
)
2846
}
@@ -55,8 +73,15 @@ testthat::test_that(
5573
testthat::expect_true(
5674
object = all(tbl$type == "X")
5775
)
76+
}
77+
)
78+
79+
80+
testthat::test_that(
81+
desc = "area_eic() validates inputs",
82+
code = {
5883
testthat::expect_error(
59-
object = party_eic("foo"),
84+
object = area_eic("foo"),
6085
regexp = 'unused argument \\("foo"\\)'
6186
)
6287
}
@@ -89,8 +114,15 @@ testthat::test_that(
89114
testthat::expect_true(
90115
object = all(tbl$type == "Y")
91116
)
117+
}
118+
)
119+
120+
121+
testthat::test_that(
122+
desc = "accounting_point_eic() validates inputs",
123+
code = {
92124
testthat::expect_error(
93-
object = area_eic("foo"),
125+
object = accounting_point_eic("foo"),
94126
regexp = 'unused argument \\("foo"\\)'
95127
)
96128
}
@@ -123,8 +155,15 @@ testthat::test_that(
123155
testthat::expect_true(
124156
object = all(tbl$type == "Z")
125157
)
158+
}
159+
)
160+
161+
162+
testthat::test_that(
163+
desc = "tie_line_eic() validates inputs",
164+
code = {
126165
testthat::expect_error(
127-
object = accounting_point_eic("foo"),
166+
object = tie_line_eic("foo"),
128167
regexp = 'unused argument \\("foo"\\)'
129168
)
130169
}
@@ -157,8 +196,15 @@ testthat::test_that(
157196
testthat::expect_true(
158197
object = all(tbl$type == "T")
159198
)
199+
}
200+
)
201+
202+
203+
testthat::test_that(
204+
desc = "location_eic() validates inputs",
205+
code = {
160206
testthat::expect_error(
161-
object = tie_line_eic("foo"),
207+
object = location_eic("foo"),
162208
regexp = 'unused argument \\("foo"\\)'
163209
)
164210
}
@@ -191,8 +237,15 @@ testthat::test_that(
191237
testthat::expect_true(
192238
object = all(tbl$type == "V")
193239
)
240+
}
241+
)
242+
243+
244+
testthat::test_that(
245+
desc = "resource_object_eic() validates inputs",
246+
code = {
194247
testthat::expect_error(
195-
object = location_eic("foo"),
248+
object = resource_object_eic("foo"),
196249
regexp = 'unused argument \\("foo"\\)'
197250
)
198251
}
@@ -225,8 +278,15 @@ testthat::test_that(
225278
testthat::expect_true(
226279
object = all(tbl$type == "W")
227280
)
281+
}
282+
)
283+
284+
285+
testthat::test_that(
286+
desc = "substation_eic() validates inputs",
287+
code = {
228288
testthat::expect_error(
229-
object = resource_object_eic("foo"),
289+
object = substation_eic("foo"),
230290
regexp = 'unused argument \\("foo"\\)'
231291
)
232292
}
@@ -259,8 +319,15 @@ testthat::test_that(
259319
testthat::expect_true(
260320
object = all(tbl$type == "A")
261321
)
322+
}
323+
)
324+
325+
326+
testthat::test_that(
327+
desc = "all_allocated_eic() validates inputs",
328+
code = {
262329
testthat::expect_error(
263-
object = substation_eic("foo"),
330+
object = all_allocated_eic("foo"),
264331
regexp = 'unused argument \\("foo"\\)'
265332
)
266333
}
@@ -295,10 +362,6 @@ testthat::test_that(
295362
"display_name"
296363
)
297364
)
298-
testthat::expect_error(
299-
object = all_allocated_eic("foo"),
300-
regexp = 'unused argument \\("foo"\\)'
301-
)
302365
}
303366
)
304367

0 commit comments

Comments
 (0)