tests/testthat/test_prediction.VotingStrategy.R

testthat::test_that("VotingStrategy: initialize function works", {

  testthat::expect_is(VotingStrategy$new(),
                      "VotingStrategy")
})

testthat::test_that("VotingStrategy: getVotingSchemes function works", {

  testthat::expect_null(VotingStrategy$new()$getVotingSchemes())
})

testthat::test_that("VotingStrategy: getMetrics function works", {

  testthat::expect_null(VotingStrategy$new()$getMetrics())
})

testthat::test_that("VotingStrategy: execute function works", {

  testthat::expect_error(VotingStrategy$new()$execute(predictions = NULL),
                         "[VotingStrategy][FATAL] Class is abstract. Method should be defined in inherited class. Aborting...",
                         fixed = TRUE)
})

testthat::test_that("VotingStrategy: getName function works", {

  testthat::expect_equal(VotingStrategy$new()$getName(),
                         "VotingStrategy",
                         fixed = TRUE)
})
drordas/D2MCS documentation built on Aug. 27, 2022, 5:13 p.m.