Skip to content

Commit

Permalink
adds tests for internal data
Browse files Browse the repository at this point in the history
  • Loading branch information
Fox Sebastian (BNSSG CCG) authored and Fox Sebastian (BNSSG CCG) committed Jul 23, 2024
1 parent 6498ad6 commit 5599b76
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions tests/testthat/test-utils_data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
test_that("ics_names internal data", {
expect_equal(
names(ics_names),
c("East of England", "London", "Midlands", "North East and Yorkshire",
"North West", "South East", "South West"),
label = "all 7 regions are in ics names"
)
})

test_that("trust_ics_props internal data", {
expect_equal(
trust_ics_props |>
dplyr::count(ICB22CDH) |>
nrow(),
42,
label = "42 ICBs in trust to icb lookup"
)

expect_equal(
names(trust_ics_props),
c("TrustCode", "TrustName", "ICB22CDH", "proportion"),
label = "expected names in trust_ics_props"
)
})


test_that("metadata internal data", {

expect_equal(
names(metadata),
c("metric", "domain", "theme", "numerator_description", "denominator_description"),
label = "expected names in metadata"
)
})


test_that("ics_timeseries internal data", {

expect_equal(
names(ics_timeseries),
c("year", "org", "domain", "theme", "metric", "numerator", "denominator", "value"),
label = "expected names in ics_timeseries"
)
})

test_that("model_accuracy internal data", {

expect_equal(
names(model_accuracy),
c("target_variable", "mape"),
label = "expected names in model_accuracy"
)
})

test_that("model internal data", {

expect_equal(
length(names(model)),
5,
label = "expected length of model object"
)
})

test_that("lookup_ics_table internal data", {

expect_equal(
names(lookup_ics_table),
c("ICB22CD", "ICB22CDH", "ICB22NM", "NHSER22NM"),
label = "expected names in lookup_ics_table object"
)
})

0 comments on commit 5599b76

Please sign in to comment.