tests/testthat/test-die.R

test_that("test die: constructor", {
  d <- Die$new("Blue")
  expect_equal(d$getColor(), "Blue")
  expect_equal(d$getValue(), 0)
})

test_that("test die: roll", {
  d <- Die$new("Blue")
  set.seed(1)
  expect_equal(d$roll(), 1)
  expect_equal(d$getValue(), 1)
})

Try the CamelUp package in your browser

Any scripts or data that you put into this service are public.

CamelUp documentation built on Feb. 22, 2021, 9:08 a.m.