tests/testthat/test-ubci_get.R

context("test-ubci_get.R")

test_that("colume check", {
  tem <- ubci_get("UPBIT.KRW-BTC")
  col <- c("code","date","open","high","low","close","volume")
  expect_equal(names(tem), col)
})

test_that("code check", {
  expect<-ubci_get_options()$code[1]
  tem <- ubci_get(expect)
  code <- unique(tem$code)
  expect_equal(code, expect)
})

test_that("date check from", {
  chk <- tail(ubci_get("UPBIT.KRW-BTC", from = Sys.Date()-5),1)$date
  expect_equal(chk, Sys.Date()-5)
})

test_that("date check to", {
  chk <- head(ubci_get("UPBIT.KRW-BTC", to = Sys.Date()-2),1)$date
  expect_equal(chk, Sys.Date()-2)
})

Try the ubci package in your browser

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

ubci documentation built on June 11, 2019, 1:02 a.m.