tests/testthat/test-sumScoreToOptimalScore.R

library(TestGardener)

test_that("sum score gives correct optimal score", {
    load("../../data/NatMath_fittedmodel.RData")
    res <- sumScoreToOptimalScore(11.929263, AnalyzeResult$parList[[10]]$WfdList,
                                    NatMath_dataList$optList, verbose = T)
    res2 <- sumScoreToOptimalScore(1, AnalyzeResult$parList[[10]]$WfdList,
                                  NatMath_dataList$optList, verbose = T)
    res3 <- sumScoreToOptimalScore(99, AnalyzeResult$parList[[10]]$WfdList,
                                  NatMath_dataList$optList, verbose = T)
    expect_equal(c(round(res, digits = 3), res2, res3), c(5.106, 0, 100))
})
joakimwallmark/PolyOptimalIRT documentation built on Dec. 21, 2021, 1:16 a.m.