tests/testthat/test_get_index_description.R

index_symbols <- c("US1YI",
                   "USVI",
                   "USBODI",
                   "USCI")


index_description <- c(
  "U.S. One Year Confidence Index",
  "U.S. Valuation Confidence Index",
  "U.S. Buy-On-Dips Confidence Index",
  "U.S. Crash Confidence Index"
)

test_that("Index description list is Ok", {
  testthat::expect_equal(unlist(lapply(index_symbols, get_index_description)),
                         index_description)
})

test_that("get_index_description gives error with wrong code", {
  testthat::expect_error(get_index_description("XXX"))
})
EnriquePH/marketconf documentation built on Aug. 7, 2023, 1:36 p.m.