tests/testthat/test-check_sampling_method.R

test_that("use", {

  for (sampling_method in rkt_get_sampling_methods()) {
    expect_silent(check_sampling_method(sampling_method))
  }

  expect_error(
    check_sampling_method("nonsense"),
    "'sampling_method' must be a sampling method"
  )
  expect_error(
    check_sampling_method(c()),
    "'sampling_method' must be one sampling method"
  )
  expect_error(
    check_sampling_method(rkt_get_sampling_methods()),
    "'sampling_method' must be one sampling method"
  )
  expect_error(
    check_sampling_method(NULL),
    "'sampling_method' must be one sampling method"
  )
  expect_error(
    check_sampling_method(NA),
    "'sampling_method' must be a sampling method"
  )
})
richelbilderbeek/flechette documentation built on Dec. 30, 2019, 9:15 p.m.