Skip to content

Commit

Permalink
fix #41
Browse files Browse the repository at this point in the history
  • Loading branch information
anadiedrichs committed Feb 6, 2019
1 parent 0ddd409 commit 2989cb3
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/testthat/test005.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
library(frost)

context("buildMdz")

dw <- c(-2,-5,2,6,8)
tempMax <- c(10,20,30,25,29)
tmin <- c(-1,-2,3,5,10)
model <- buildMdz(dw,tempMax,tmin)

test_that("Check output ", {
expect_is(model,"MdzFrostModel")
expect_is(model@k,"numeric")
})

test_that("Check errors for null arguments ", {

expect_error(buildMdz(NULL,tempMax,tmin))
expect_error(buildMdz(dw,NULL,tmin))
expect_error(buildMdz(dw,tempMax,NULL))
})


context("predMdz")
#TODO podria recibir mas de un valor o un arreglo en dw ??
pred <- predMdz(dw = -3, tempMax = 15, model)

test_that("Check output ", {
expect_is(pred,"numeric")
})

test_that("Check errors for null arguments ", {

expect_error(predMdz(dw = -3, tempMax = NULL, model))
expect_error(predMdz(dw = -3, tempMax = 15, NULL))
expect_error(bpredMdz(dw = NULL, tempMax = 15, model))
})

0 comments on commit 2989cb3

Please sign in to comment.