diff --git a/_pkgdown.yml b/_pkgdown.yml index 35e4ba5..a6ef5cd 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,5 +1,4 @@ url: https://spatiotemporal-exposures-and-toxicology.github.io/GeoToxPackage/ template: bootstrap: 5 - bootswatch: sandstone diff --git a/tests/testthat/test-simulate_age.R b/tests/testthat/test-simulate_age.R index 29fc07d..e1af21b 100644 --- a/tests/testthat/test-simulate_age.R +++ b/tests/testthat/test-simulate_age.R @@ -1,4 +1,24 @@ -test_that("inputs", { +test_that("simulate_age returns errors from bad inputs", { + # errors from bad input expect_error(simulate_age(data.frame())) + # errors from bad order expect_error(simulate_age(data.frame(AGEGRP = 0, TOT_POP = 0))) + # +}) + + +test_that("age samples are good", { + + x <- data.frame(AGEGRP = 0:18, TOT_POP = c(sum(1:18), 1:18)) + ages_test <- simulate_age(x, 10) + + + # age sample is of size "n" + expect_vector(ages_test,size = 10) + + # age samples are within allowed age range [0,90] t + expect_true(all(ages_test < 90 & ages_test >= 0)) + + + # })