Skip to content

Commit

Permalink
added tests for internal function
Browse files Browse the repository at this point in the history
  • Loading branch information
Fersoil authored and Fersoil committed Nov 2, 2024
1 parent 0e88e90 commit d4a29f1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test-plots_plate.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,20 @@ test_that("properly specified thresholds for counts", {
plate <- get_real_plate()
expect_no_error(p <- plot_counts(plate, "OC43_NP_NA", plot_counts = FALSE, plot_legend = TRUE, lower_threshold = 50, higher_threshold = 150))
})

test_that("test plot_plate internal function", {
plate <- get_test_plate()
colours <- rep("red", 96)
legend_mapping <- c("BLANK" = "red", "STANDARD CURVE" = "blue", "TEST" = "green")
expect_no_error(plot_plate(colours, legend_mapping = legend_mapping))

# incorrect colours length
expect_error(plot_plate(colours[1:95], legend_mapping = legend_mapping))

# incorrect legend mapping
colours <- rep(c("red", "blue"), 48)
legend_mapping <- c("BLANK" = "red")
expect_error(plot_plate(colours, legend_mapping = legend_mapping))

})

0 comments on commit d4a29f1

Please sign in to comment.