Skip to content

Commit

Permalink
Comment Josh's unit tests for DEqual()
Browse files Browse the repository at this point in the history
  • Loading branch information
HediaTnani committed Jan 9, 2024
1 parent c936b18 commit eb6ff98
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/testthat/test-DEqual.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
# Create a data frame 'random_de'. This data frame is created by:
# 1. Generating a vector 't' with random t-distribution values. The 'rt' function is used to generate
# these values, where 'nrow(degradation_tstats)' specifies the number of values and '5' is the degrees of freedom.
# 2. Setting the row names of 'random_de' to a random sample of the row names from 'degradation_tstats'.
# 'sample' function is used for sampling, and 'nrow(degradation_tstats)' gives the number of samples to draw.
# 3. The data frame 'random_de' is then used as input for the function 'DEqual' to generate a ggplot object.
random_de <- data.frame(
t = rt(nrow(degradation_tstats), 5),
row.names = sample(rownames(degradation_tstats), nrow(degradation_tstats))
)


# Test that the output is a ggplot object
test_that("output is a ggplot", {
expect_equal(class(DEqual(random_de))[1], "gg")
})

# Test that the output is a ggplot object
test_that("output is a ggplot", {
expect_equal(class(DEqual(random_de))[2], "ggplot")
})


0 comments on commit eb6ff98

Please sign in to comment.