Skip to content

Commit

Permalink
added test for maximum date
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsantiagoquevedo committed Oct 3, 2023
1 parent 9908f54 commit 5993222
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/testthat/test-immunization_date.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,22 @@ test_that("`get_immunization_date`: Take first vaccination", {
all(vax_difference == immunization_delay)
)
})

test_that("`get_immunization_date`: end_cohort > max_date", {
data("cohortdata")
cohortdata <- as.data.frame(cohortdata)

# get immunization dates
expect_warning(
get_immunization_date(
data = cohortdata,
outcome_date_col = "death_date",
outcome_delay = 0,
immunization_delay = 14,
vacc_date_col = c("vaccine_date_1", "vaccine_date_2"),
end_cohort = as.Date("2101-12-31"),
take_first = FALSE
)
)

})

0 comments on commit 5993222

Please sign in to comment.