-
Notifications
You must be signed in to change notification settings - Fork 12
/
test-get.R
30 lines (23 loc) · 1.26 KB
/
test-get.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
context("get")
skip_on_cran()
sT <- read_secuTrial(system.file("extdata", "sT_exports", "exp_opt",
"s_export_CSV-xls_CTU05_all_info.zip",
package = "secuTrialR"))
sT_noid <- read_secuTrial(system.file("extdata", "sT_exports", "exp_opt",
"s_export_CSV-xls_CTU05_no_addid.zip",
package = "secuTrialR"))
sT_nocentre <- read_secuTrial(system.file("extdata", "sT_exports", "exp_opt",
"s_export_CSV-xls_CTU05_no_centre_info.zip",
package = "secuTrialR"))
sT_noid_nocentre <- read_secuTrial(system.file("extdata", "sT_exports", "exp_opt",
"s_export_CSV-xls_CTU05_no_addid_ctr_info_proj_setup.zip",
package = "secuTrialR"))
test_that("Get participant error", {
expect_error(get_participants(data.frame()))
})
test_that("Get participants", {
expect_equal(c(11, 4), dim(get_participants(sT)))
expect_equal(c(11, 3), dim(get_participants(sT_noid)))
expect_equal(c(11, 2), dim(get_participants(sT_nocentre)))
expect_equal(c(11, 1), dim(get_participants(sT_noid_nocentre)))
})