Skip to content

Commit

Permalink
A unit test is added
Browse files Browse the repository at this point in the history
  • Loading branch information
alishersuyunov committed Jul 2, 2020
1 parent a54406d commit 405a242
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
12 changes: 10 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@ Imports:
lubridate,
tidyr,
xml2
Suggests: knitr, rmarkdown, quantmod, tidyverse, PerformanceAnalytics, tidyquant, kableExtra, formattable
Suggests:
knitr,
rmarkdown,
quantmod,
tidyverse,
PerformanceAnalytics,
tidyquant,
kableExtra,
formattable,
testthat
VignetteBuilder: knitr
URL: https://github.com/alishersuyunov/opendatauzb
BugReports: https://github.com/alishersuyunov/opendatauzb/issues
LazyData: false
RoxygenNote: 7.1.1

4 changes: 4 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
library(testthat)
library(opendatauzb)

test_check("opendatauzb")
23 changes: 23 additions & 0 deletions tests/testthat/testDate.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
library("opendatauzb")

test_that("Date is processed properly", {
expect_error(getTicker("UZ7011340005",
from = "2020-01-01",
to = "30.06.2020"))
expect_error(getMarketIndex("finance",
from = "2020-01-01",
to = "30.06.2020"))

})

test_that("Returned objects are correct", {
expect_s3_class(getMarketIndex("finance",
from = "01.06.2020",
to = "30.06.2020"), "data.frame")
expect_s3_class(getTicker("UZ7011340005",
from = "01.06.2020",
to = "30.06.2020"), "data.frame")

expect_s3_class(currentBidsAsks(), "data.frame")
expect_s3_class(ipo(), "data.frame")
})

0 comments on commit 405a242

Please sign in to comment.