tests/testthat/test-getHistory.R

test_that("getHistory function returns a data frame", {
  df <- getHistory(CERT_or_NAME = 3850, fields = c("NAME","CITY","STNAME"), CERT = TRUE, limit = 1000)
  expect_is(df, "data.frame")
})

test_that("getHistory function returns data in the correct format and structure", {
  df <- getHistory(CERT_or_NAME = 3850, fields = c("NAME","CITY","STNAME"), CERT = TRUE, limit = 1000)
  expect_gte(nrow(df), 0)
})

test_that("getHistory function returns NULL if fields parameter is missing", {
  expect_error(getHistory(CERT_or_NAME = "Bank of America", CERT = FALSE, limit = 1000))
})

Try the fdicdata package in your browser

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

fdicdata documentation built on Sept. 12, 2024, 5:08 p.m.