tests/testthat/test-creatingContestants.R

#check the creating initial contestants
test_that("check creating the initial contestants", {
  expect_equal(nrow(createContestants(6)), 6)
  expect_equal(ncol(createContestants(6)), 2)
  expect_equal(names(createContestants(6)), c("female", "male"))
  expect_identical(map_chr(createContestants(3), typeof), c("female" = "character", "male" = "character"))
  expect_error(createContestants("a"), "contestants MUST be a whole number greater than 1")
  expect_error(createContestants(1), "contestants MUST be a whole number greater than 1")
  expect_error(createContestants(FALSE), "contestants MUST be a whole number greater than 1")
})
NotThatKindODr/Are-You-The-One-Sim documentation built on Dec. 17, 2021, 12:51 p.m.