context("unit test for TableWare Object")
test_that("Instantiating a TableWare on mtcars appends it DQA operations", {
# Invalid input arguments
expect_error(TableWare$new())
expect_error(TableWare$new(mtcars, data.frame()))
# Valid input argument
expect_silent(mtcars_profile <- TableProfiler$new(mtcars)$profile)
expect_class(TW <- TableWare$new(mtcars, mtcars_profile), "TableWare")
expect_class(TW$table, "data.frame")
})
test_that("TableWare methods run", {
expect_silent(mtcars_profile <- TableProfiler$new(mtcars)$profile)
expect_class(
TableWare$new(mtcars, mtcars_profile)$convert_col_types(),
"data.frame"
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.