1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 20:41:58 +02:00

(v1.5.0.9017) unit testing

This commit is contained in:
2021-02-08 21:09:36 +01:00
parent 4a84894f79
commit cb404492b2
20 changed files with 47 additions and 36 deletions

View File

@ -47,7 +47,7 @@ test_that("mdro works", {
library(dplyr)
# example_isolates should have these finding using Dutch guidelines
expect_equal(as.double(table(outcome)),
c(1969, 25, 6)) # 1969 neg, 25 unconfirmed, 6 pos
c(1970, 24, 6)) # 1970 neg, 24 unconfirmed, 6 pos
expect_equal(brmo(example_isolates, info = FALSE),
mdro(example_isolates, guideline = "BRMO", info = FALSE))
@ -241,4 +241,9 @@ test_that("mdro works", {
guideline = custom_mdro_guideline(test ~ "A"),
info = FALSE))
# print groups
library(dplyr)
expect_output(x <- mdro(example_isolates %>% group_by(hospital_id), info = TRUE))
expect_output(x <- mdro(example_isolates %>% group_by(hospital_id), guideline = custom, info = TRUE))
})