Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ross-hull committed Jul 5, 2024
1 parent 4bbbbef commit e2e9cbd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/testthat/test-get_dataset_additional_info.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test_that("returns data in the expected format", {
expect_s3_class(get_dataset_additional_info("weekly-accident-and-emergency-activity-and-waiting-times"), "tbl_df")
})

test_that("returned tibble has one row", {
expect_equal(nrow(get_dataset_additional_info("weekly-accident-and-emergency-activity-and-waiting-times")), 1)
})
10 changes: 10 additions & 0 deletions tests/testthat/test-get_latest_resource.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test_that("returns more than 0 datasets", {
# select the first row of the tibble and get the
# number of rows. If no datasets were returned
# this will be 0
expect_equal(nrow(dplyr::slice(list_datasets(), 1)), 1)
})

test_that("returns data in the expected format", {
expect_s3_class(list_datasets(), "tbl_df")
})

0 comments on commit e2e9cbd

Please sign in to comment.