tests/testthat/test_GaugeAxis_setters.R

context("GaugeAxis setters (class unions)")

testthat::test_that("setBands", {
  bands <- list(startValue = 0, endValue = 100)
  testthat::expect_error(gaugeAxis(bands = bands))
  testthat::expect_error(setBands(.Object = gaugeAxis(), bands = bands))
})

testthat::test_that("addBand", {
  testthat::expect_error(addBand(.Object = gaugeAxis()))
  testthat::expect_error(addBand(.Object = gaugeAxis(), band = "test"))
  band_obj <- list(startValue = 0, endValue = 100)
  testthat::expect_error(addBand(.Object = gaugeAxis(), band = c(band_obj, band_obj)))
})
datastorm-open/rAmCharts documentation built on Oct. 4, 2022, 7:07 p.m.