tests/testthat/test-model-err.R

context('lcModel implementation error')

setClass('lcModelErr', contains = 'lcModel')
model = testModel
class(model) = 'lcModelErr'

test_that('clusterProportions', {
  setMethod('clusterProportions', 'lcModelErr', function(object, ...) NULL)

  expect_error(clusterProportions(model), 'lcModelErr')
})

test_that('clusterTrajectories', {
  setMethod('clusterTrajectories', 'lcModelErr', function(object, ...) NULL)

  expect_error(clusterTrajectories(model), 'lcModelErr')
})

test_that('postprob', {
  setMethod('postprob', 'lcModelErr', function(object, ...) NULL)

  expect_error(postprob(model), 'lcModelErr')
})

test_that('predictForCluster', {
  setMethod('predictForCluster', 'lcModelErr', function(object, ...) NULL)

  expect_error(predictForCluster(model, cluster = 'A'), 'lcModelErr')
})

Try the latrend package in your browser

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

latrend documentation built on March 31, 2023, 5:45 p.m.