tests/testthat/test-methods-dfba_mcnemar.R

# McNemar methods test

set.seed(77)
library(vdiffr)

object <- dfba_mcnemar(n_01 = 17,
                       n_10 = 2)
test_that("Show method works",{
  expect_output(show(object))
})

test_that("Plot method works with prior",{
  expect_doppelganger(
    title = "mcnemar_prior_plot",
    fig = plot(object)
  )
})

test_that("Plot method works without prior",{
  expect_doppelganger(
    title = "mcnemar_noprior_plot",
    fig = plot(object,
               plot.prior = FALSE)
  )
})

Try the DFBA package in your browser

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

DFBA documentation built on May 29, 2024, 10:36 a.m.