Skip to content

Commit c26cca9

Browse files
committed
Update tests
1 parent f70e7e6 commit c26cca9

5 files changed

Lines changed: 32 additions & 32 deletions

tests/testthat/test-autoplot.summary.seroincidence.by.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test_that(
1515
noise <-
1616
example_noise_params_pk
1717

18-
est2 <- estimate_scr_by(
18+
est2 <- est_seroincidence_by(
1919
strata = c("catchment", "ageCat"),
2020
pop_data = xs_data,
2121
curve_params = curve,
@@ -70,7 +70,7 @@ test_that(
7070
noise <-
7171
example_noise_params_pk
7272

73-
est2 <- estimate_scr_by(
73+
est2 <- est_seroincidence_by(
7474
strata = c("catchment", "ageCat"),
7575
pop_data = xs_data,
7676
curve_params = curve,
@@ -111,7 +111,7 @@ test_that(
111111
noise <-
112112
example_noise_params_pk
113113

114-
est2 <- estimate_scr_by(
114+
est2 <- est_seroincidence_by(
115115
strata = c("catchment", "ageCat"),
116116
pop_data = xs_data,
117117
curve_params = curve,
@@ -154,7 +154,7 @@ test_that(
154154
noise <-
155155
example_noise_params_pk
156156

157-
est2 <- estimate_scr_by(
157+
est2 <- est_seroincidence_by(
158158
strata = c("catchment", "ageCat"),
159159
pop_data = xs_data,
160160
curve_params = curve,
@@ -198,7 +198,7 @@ test_that(
198198
noise <-
199199
example_noise_params_pk
200200

201-
est2 <- estimate_scr_by(
201+
est2 <- est_seroincidence_by(
202202
strata = c("catchment", "ageCat"),
203203
pop_data = xs_data,
204204
curve_params = curve,

tests/testthat/test-est_seroincidence_by.R

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
test_that(
2-
desc = "estimate_scr_by() warns about missing data",
2+
desc = "est_seroincidence_by() warns about missing data",
33
code = {
44

55
withr::local_package("dplyr")
66
withr::local_package("readr")
77

8-
estimate_scr_by(
8+
est_seroincidence_by(
99
pop_data =
1010
sees_pop_data_pk_100 |>
1111
dplyr::filter(catchment == "kgh" | antigen_iso == "HlyE_IgA"),
@@ -22,13 +22,13 @@ test_that(
2222
)
2323

2424

25-
test_that("estimate_scr_by() warns about missing data", {
25+
test_that("est_seroincidence_by() warns about missing data", {
2626

2727
withr::local_package("dplyr")
2828
withr::local_package("readr")
2929

3030

31-
estimate_scr_by(
31+
est_seroincidence_by(
3232
pop_data = sees_pop_data_pk_100 |>
3333
tail(-1),
3434
curve_params = typhoid_curves_nostrat_100,
@@ -41,9 +41,9 @@ test_that("estimate_scr_by() warns about missing data", {
4141
expect_warning(class = "incomplete-obs")
4242
})
4343

44-
test_that("`estimate_scr_by()` warns user when strata is missing", {
44+
test_that("`est_seroincidence_by()` warns user when strata is missing", {
4545
expect_warning(
46-
estimate_scr_by(
46+
est_seroincidence_by(
4747
pop_data = sees_pop_data_pk_100,
4848
curve_params = typhoid_curves_nostrat_100,
4949
noise_params = example_noise_params_pk,
@@ -54,11 +54,11 @@ test_that("`estimate_scr_by()` warns user when strata is missing", {
5454
})
5555

5656
test_that(
57-
"`estimate_scr_by()` aborts when elements that don't exactly
57+
"`est_seroincidence_by()` aborts when elements that don't exactly
5858
match the columns of `pop_data` are provided",
5959
{
6060
expect_error(
61-
object = estimate_scr_by(
61+
object = est_seroincidence_by(
6262
strata = c("ag", "catch", "Count"),
6363
pop_data = sees_pop_data_pk_100,
6464
curve_params = typhoid_curves_nostrat_100,
@@ -76,10 +76,10 @@ test_that(
7676

7777

7878
test_that(
79-
desc = "`estimate_scr_by()` produces consistent results for typhoid data",
79+
desc = "`est_seroincidence_by()` produces consistent results for typhoid data",
8080
code = {
8181
withr::local_options(width = 80)
82-
typhoid_results <- estimate_scr_by(
82+
typhoid_results <- est_seroincidence_by(
8383
strata = "catchment",
8484
pop_data = sees_pop_data_pk_100,
8585
curve_param = typhoid_curves_nostrat_100,
@@ -99,10 +99,10 @@ test_that(
9999
)
100100

101101
test_that(
102-
"`estimate_scr_by()` produces expected results
102+
"`est_seroincidence_by()` produces expected results
103103
regardless of whether varnames have been standardized.",
104104
{
105-
est_true <- estimate_scr_by(
105+
est_true <- est_seroincidence_by(
106106
strata = c("catchment"),
107107
pop_data = sees_pop_data_pk_100,
108108
curve_params = typhoid_curves_nostrat_100,
@@ -113,7 +113,7 @@ test_that(
113113
num_cores = 1 # Allow for parallel processing to decrease run time
114114
)
115115

116-
est_false <- estimate_scr_by(
116+
est_false <- est_seroincidence_by(
117117
strata = c("catchment"),
118118
pop_data = sees_pop_data_pk_100_old_names,
119119
curve_params = typhoid_curves_nostrat_100,
@@ -130,11 +130,11 @@ test_that(
130130

131131

132132
test_that(
133-
"`estimate_scr_by()` produces expected results
133+
"`est_seroincidence_by()` produces expected results
134134
regardless of whether using parallel processing or not.",
135135
{
136136

137-
ests_1_core <- estimate_scr_by(
137+
ests_1_core <- est_seroincidence_by(
138138
strata = c("catchment"),
139139
pop_data = sees_pop_data_pk_100,
140140
curve_params = typhoid_curves_nostrat_100,
@@ -145,7 +145,7 @@ test_that(
145145
num_cores = 1
146146
)
147147

148-
ests_2_cores <- estimate_scr_by(
148+
ests_2_cores <- est_seroincidence_by(
149149
strata = c("catchment"),
150150
pop_data = sees_pop_data_pk_100_old_names,
151151
curve_params = typhoid_curves_nostrat_100,
@@ -161,15 +161,15 @@ test_that(
161161
)
162162

163163
test_that(
164-
"`estimate_scr_by()` produces expected results
164+
"`est_seroincidence_by()` produces expected results
165165
regardless of whether using verbose messaging or not.
166166
with single core.",
167167
{
168168

169169
capture.output(
170170
file = nullfile(),
171171
{
172-
ests_verbose_sc <- estimate_scr_by(
172+
ests_verbose_sc <- est_seroincidence_by(
173173
strata = c("catchment"),
174174
pop_data = sees_pop_data_pk_100,
175175
curve_params = typhoid_curves_nostrat_100,
@@ -183,7 +183,7 @@ test_that(
183183
}
184184
)
185185

186-
ests_non_verbose_sc <- estimate_scr_by(
186+
ests_non_verbose_sc <- est_seroincidence_by(
187187
verbose = FALSE,
188188
strata = c("catchment"),
189189
pop_data = sees_pop_data_pk_100_old_names,
@@ -200,12 +200,12 @@ test_that(
200200
)
201201

202202
test_that(
203-
"`estimate_scr_by()` produces expected results
203+
"`est_seroincidence_by()` produces expected results
204204
regardless of whether using verbose messaging or not
205205
with multi-core processing.",
206206
{
207207

208-
ests_verbose_mc <- estimate_scr_by(
208+
ests_verbose_mc <- est_seroincidence_by(
209209
strata = c("catchment"),
210210
pop_data = sees_pop_data_pk_100,
211211
curve_params = typhoid_curves_nostrat_100,
@@ -218,7 +218,7 @@ test_that(
218218
) |>
219219
suppressMessages()
220220

221-
ests_non_verbose_mc <- estimate_scr_by(
221+
ests_non_verbose_mc <- est_seroincidence_by(
222222
verbose = FALSE,
223223
strata = c("catchment"),
224224
pop_data = sees_pop_data_pk_100_old_names,
@@ -241,7 +241,7 @@ test_that(
241241
test_that(
242242
"a warning is produced when `strata = NULL",
243243
code = {
244-
estimate_scr_by(
244+
est_seroincidence_by(
245245
strata = NULL,
246246
pop_data = sees_pop_data_pk_100,
247247
curve_param = typhoid_curves_nostrat_100,
@@ -260,7 +260,7 @@ test_that("results are consistent with `strata = NULL`", {
260260
antigen_isos = c("HlyE_IgG", "HlyE_IgA")
261261
)
262262

263-
typhoid_results_nullstrata <- estimate_scr_by(
263+
typhoid_results_nullstrata <- est_seroincidence_by(
264264
strata = NULL,
265265
pop_data = sees_pop_data_pk_100,
266266
curve_param = typhoid_curves_nostrat_100,

tests/testthat/test-print.seroincidence.by.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ test_that(
33
code = {
44

55
withr::local_options(width = 80)
6-
typhoid_results <- estimate_scr_by(
6+
typhoid_results <- est_seroincidence_by(
77
strata = "catchment",
88
pop_data = sees_pop_data_pk_100,
99
curve_param = typhoid_curves_nostrat_100,

tests/testthat/test-print.summary.seroincidence.by.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
test_that("print method works consistently", {
22
withr::local_options(width = 80)
3-
typhoid_results <- estimate_scr_by(
3+
typhoid_results <- est_seroincidence_by(
44
strata = "catchment",
55
pop_data = sees_pop_data_pk_100,
66
curve_param = typhoid_curves_nostrat_100,

tests/testthat/test-summary.seroincidence.by.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
test_that("`summary.seroincidence.by()` produces consistent results",
22
{
33
typhoid_results <-
4-
estimate_scr_by(
4+
est_seroincidence_by(
55
strata = "catchment",
66
pop_data = sees_pop_data_pk_100,
77
curve_param = typhoid_curves_nostrat_100,

0 commit comments

Comments
 (0)