[efa494]: / tests / testthat / test-class.R

Download this file

34 lines (29 with data), 954 Bytes

 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
31
32
33
library(SummarizedExperiment)
library(biotmleData)
data(illuminaData)
## SETUP TESTS ################################################################
example_biotmle_class <- function(se) {
call <- match.call(expand.dots = TRUE)
biotmle <- .biotmle(
SummarizedExperiment(
assays = assay(se),
rowData = rowData(se),
colData = colData(se)
),
call = call,
tmleOut = as.data.frame(matrix(NA, 10, 10)),
topTable = as.data.frame(matrix(NA, 10, 10))
)
return(biotmle)
}
biotmle <- example_biotmle_class(se = illuminaData)
## BEGIN TESTS ################################################################
test_that("biotmle object is of class type S4", {
expect_equivalent(typeof(biotmle), "S4")
})
test_that("biotmle object is of appropriate class", {
expect_equivalent(class(biotmle), "bioTMLE")
})
test_that("biotmle is a subclass of SummarizedExperiment", {
expect_is(biotmle, "SummarizedExperiment")
})