tests/testthat/testGenericList.R

library(testthat)

context("Test the generic list")

source(paste0("", "testUtils.R"))

test_that("GetByIndex method works well", {
  model <- model_suite$testing$nonmem$advan4_trans4
  
  depot <- model@compartments %>% getByIndex(1)
  expect_equal(depot@name, "DEPOT")
  
  expect_error(model@compartments %>% getByIndex(5), regexp="Can't find element at index 5")
})

Try the campsismod package in your browser

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

campsismod documentation built on May 29, 2024, 8:48 a.m.