tests/testthat/test_population_dynamics_class.R

context('population_dynamics-class')

test_that('population_dynamics classes work', {

  func <- function(x) x
  
  expect_true(inherits(population_dynamics(func),"population_dynamics"))
  
  expect_true(is.population_dynamics(population_dynamics(func)))

  expect_error(as.population_dynamics(1))
  
  expect_error(population_dynamics(change = NULL,
                                   dispersal = NULL,
                                   modification = NULL,
                                   density_dependence = NULL,
                                   dynamics_order = "change"))
    
  # print(population_dynamics(func))
  
})

Try the steps package in your browser

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

steps documentation built on May 2, 2019, 9:41 a.m.