Commit 6e951cbc authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

test(PrepGR): when custom column names used in ObsDF

and when ObsDF is a tibble data.frame
- tibble now added to the 'Suggests' list of the DECRIPTION file
Refs #49
parent 64080567
Pipeline #28232 passed with stage
in 1 minute and 28 seconds
......@@ -27,6 +27,7 @@ Suggests:
knitr,
rmarkdown,
testthat,
tibble,
htmlwidgets (>= 1.5.3)
Description: Add-on package to the 'airGR' package that simplifies its use and is aimed at being used for teaching hydrology. The package provides 1) three functions that allow to complete very simply a hydrological modelling exercise 2) plotting functions to help students to explore observed data and to interpret the results of calibration and simulation of the GR ('Génie rural') models 3) a 'Shiny' graphical interface that allows for displaying the impact of model parameters on hydrographs and models internal variables.
License: GPL-2
......
context("PrepGR")
# --------
library(tibble)
# --------
data(L0123001, package = "airGR")
BasinObs <- BasinObs[, c("DatesR", "P", "E", "Qmm", "T")]
BasinObs2 <- BasinObs
colnames(BasinObs2) <- letters[seq_along(colnames(BasinObs2))]
# --------
test_that("ObsDF with custom column names", {
expect_equal(
object = PrepGR(ObsDF = BasinObs, HydroModel = "GR4J", CemaNeige = FALSE)
,
expected = PrepGR(ObsDF = BasinObs2, HydroModel = "GR4J", CemaNeige = FALSE),
)
})
# ----
test_that("ObsDF is a tibble data.frame", {
expect_equal(
object = PrepGR(ObsDF = BasinObs, HydroModel = "GR4J", CemaNeige = FALSE)
,
expected = PrepGR(ObsDF = as_tibble(BasinObs), HydroModel = "GR4J", CemaNeige = FALSE),
)
})
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment