test-PrepGR.R 743 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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),
  )
})