diff --git a/tests/testthat/test-encounter_creator.R b/tests/testthat/test-encounter_creator.R new file mode 100644 index 0000000..e23c887 --- /dev/null +++ b/tests/testthat/test-encounter_creator.R @@ -0,0 +1,23 @@ +# Run all tests in this script: +## testthat::test_file(file.path("tests", "testthat", "test-encounter_creator.R")) + +# # Error testing +# test_that("Errors work as desired", { +# All inputs received from/tested in `xp_pool` and/or `xp_cost` +# }) + +# # Warning testing +# test_that("Warnings work as desired", { +# # No warnings in this function +# }) + +# # Message testing +# test_that("Messages work as desired", { +# # No messages in this function +# }) + +# Output testing +test_that("Outputs are as expected", { + my_battle <- encounter_creator(party_level = 10, party_size = 4, difficulty = "hard") + expect_equal(class(my_battle), c("tbl_df", "tbl", "data.frame")) +}) diff --git a/tests/testthat/test-reroll.R b/tests/testthat/test-reroll.R new file mode 100644 index 0000000..c629a9d --- /dev/null +++ b/tests/testthat/test-reroll.R @@ -0,0 +1,26 @@ +# Run all tests in this script: +## testthat::test_file(file.path("tests", "testthat", "test-reroll.R")) + +# NO INPUT TESTS CURRENTLY NEEDED +## `reroll` is only used inside of `roll` so it is not possible for it receive improper inputs + +# # Error testing +# test_that("Errors work as desired", { +# All inputs received from/tested in `roll` +# }) + +# # Warning testing +# test_that("Warnings work as desired", { +# # No warnings in this function +# }) + +# # Message testing +# test_that("Messages work as desired", { +# # No messages in this function +# }) + +# Output testing +test_that("Outputs are as expected", { + new_values <- reroll(dice_faces = 1, first_result = c(1, 1, 5, 3, 6)) + expect_equal(class(new_values), "numeric") +})