tests/testthat/test_get_all_factors.R

context("get_all_factors")

test_that("get_all_factors provides proper messages and warnings", {

  expect_that(get_all_factors(letters), throws_error())

})

test_that("get_all_factors output is a list", {

  expect_true(get_all_factors(1:10) %>% is.list)

})

test_that("get_all_factors computes appropriately", {

  expect_equal(get_all_factors(27) %>% .[[1]], c(1, 3, 9, 27))

})
bradleyboehmke/anomalyDetection documentation built on Oct. 15, 2019, 12:04 a.m.