context("Test getActiveSymbols")
test_that("function returns correct data.", {
start.date <- as.Date("2009-01-01")
end.date <- as.Date("2009-12-31")
result <- getActiveSymbols(settings$sharadar.sqli, start.date, end.date)
expect_is(result, "character")
expect_gte(length(result), 5000)
result <- getActiveSymbols(settings$quotemedia.sqli, start.date, end.date)
expect_is(result, "character")
expect_length(result, 4279)
})
test_that("function check inputs correctly.", {
for (dbcon.str in c(settings$sharadar.sqli, settings$quotemedia.sqli)) {
expect_error(getActiveSymbols(dbcon.str, "hoge", "2009-12-31"),
"character string is not in a standard unambiguous format")
expect_error(getActiveSymbols(dbcon.str, "2009-01-01", "hoge"),
"character string is not in a standard unambiguous format")
}
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.