#------------------------------------------------------------------------------
test_that("consequences nominal", {
  test_con_nominal_weak_dyn<-get_consequences(
    measure_typ = "dynamic_iota_index",
    measure_1_val = 1.00,
    level = .95,
    strength = "weak",
    data_type = "nominal",
    sample_size = 500)
  testthat::expect_equal(test_con_nominal_weak_dyn["deviation","practically no effect"],
                         .933)
  testthat::expect_equal(test_con_nominal_weak_dyn["deviation","practically weak effect"],
                         .999)
  testthat::expect_equal(test_con_nominal_weak_dyn["classification rate","practically no effect"],
                         .817)
  testthat::expect_equal(test_con_nominal_weak_dyn["classification rate","practically weak effect"],
                         .958)
  testthat::expect_equal(test_con_nominal_weak_dyn["risk of Type I errors","practically no effect"],
                         .833)
  testthat::expect_equal(test_con_nominal_weak_dyn["risk of Type I errors","practically weak effect"],
                         .964)

  test_con_nominal_medium_dyn<-get_consequences(
    measure_typ = "dynamic_iota_index",
    measure_1_val = 1.00,
    level = .95,
    strength = "medium",
    data_type = "nominal",
    sample_size = 500)
  testthat::expect_equal(test_con_nominal_medium_dyn["deviation","practically no effect"],
                         .849)
  testthat::expect_equal(test_con_nominal_medium_dyn["deviation","practically weak effect"],
                         .999)
  testthat::expect_equal(test_con_nominal_medium_dyn["classification rate","practically no effect"],
                         .002)
  testthat::expect_equal(test_con_nominal_medium_dyn["classification rate","practically weak effect"],
                         .064)
  testthat::expect_equal(test_con_nominal_medium_dyn["risk of Type I errors","practically no effect"],
                         .999)
  testthat::expect_equal(test_con_nominal_medium_dyn["risk of Type I errors","practically weak effect"],
                         .999)

  test_con_nominal_strong_dyn<-get_consequences(
    measure_typ = "dynamic_iota_index",
    measure_1_val = 1.00,
    level = .95,
    strength = "strong",
    data_type = "nominal",
    sample_size = 500)
  testthat::expect_equal(test_con_nominal_strong_dyn["deviation","practically no effect"],
                         .789)
  testthat::expect_equal(test_con_nominal_strong_dyn["deviation","practically weak effect"],
                         .998)
  testthat::expect_equal(test_con_nominal_strong_dyn["classification rate","practically no effect"],
                         .999)
  testthat::expect_equal(test_con_nominal_strong_dyn["classification rate","practically weak effect"],
                         .999)
  testthat::expect_equal(test_con_nominal_strong_dyn["risk of Type I errors","practically no effect"],
                         .999)
  testthat::expect_equal(test_con_nominal_strong_dyn["risk of Type I errors","practically weak effect"],
                         .999)


})
#------------------------------------------------------------------------------
test_that("consequences ordinal", {
  test_con_ordinal_weak_dyn<-get_consequences(
    measure_typ = "dynamic_iota_index",
    measure_1_val = 1.00,
    level = .95,
    strength = "weak",
    data_type = "ordinal",
    sample_size = 500)
  testthat::expect_equal(test_con_ordinal_weak_dyn["deviation","practically no effect"],
                         .877)
  testthat::expect_equal(test_con_ordinal_weak_dyn["deviation","practically weak effect"],
                         .999)
  testthat::expect_equal(test_con_ordinal_weak_dyn["classification rate","practically no effect"],
                         .584)
  testthat::expect_equal(test_con_ordinal_weak_dyn["classification rate","practically weak effect"],
                         .874)
  testthat::expect_equal(test_con_ordinal_weak_dyn["risk of Type I errors","practically no effect"],
                         .997)
  testthat::expect_equal(test_con_ordinal_weak_dyn["risk of Type I errors","practically weak effect"],
                         .999)

  test_con_ordinal_medium_dyn<-get_consequences(
    measure_typ = "dynamic_iota_index",
    measure_1_val = 1.00,
    level = .95,
    strength = "medium",
    data_type = "ordinal",
    sample_size = 500)
  testthat::expect_equal(test_con_ordinal_medium_dyn["deviation","practically no effect"],
                         .724)
  testthat::expect_equal(test_con_ordinal_medium_dyn["deviation","practically weak effect"],
                         .999)
  testthat::expect_equal(test_con_ordinal_medium_dyn["classification rate","practically no effect"],
                         .007)
  testthat::expect_equal(test_con_ordinal_medium_dyn["classification rate","practically weak effect"],
                         .197)
  testthat::expect_equal(test_con_ordinal_medium_dyn["risk of Type I errors","practically no effect"],
                         .999)
  testthat::expect_equal(test_con_ordinal_medium_dyn["risk of Type I errors","practically weak effect"],
                         .999)

  test_con_ordinal_strong_dyn<-get_consequences(
    measure_typ = "dynamic_iota_index",
    measure_1_val = 1.00,
    level = .95,
    strength = "strong",
    data_type = "ordinal",
    sample_size = 500)
  testthat::expect_equal(test_con_ordinal_strong_dyn["deviation","practically no effect"],
                         .617)
  testthat::expect_equal(test_con_ordinal_strong_dyn["deviation","practically weak effect"],
                         .993)
  testthat::expect_equal(test_con_ordinal_strong_dyn["classification rate","practically no effect"],
                         .645)
  testthat::expect_equal(test_con_ordinal_strong_dyn["classification rate","practically weak effect"],
                         .998)
  testthat::expect_equal(test_con_ordinal_strong_dyn["risk of Type I errors","practically no effect"],
                         .999)
  testthat::expect_equal(test_con_ordinal_strong_dyn["risk of Type I errors","practically weak effect"],
                         .999)


})
