Skip to content

Commit

Permalink
get_gene_info unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattssca committed Jan 9, 2024
1 parent 3c2bbce commit 1f30f86
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/testthat/test-get_gene_infoR.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#load pacakges
library(testthat)


test_that("Check for rows and column consistencies", {
expect_equal(nrow(get_gene_info(these_genes = "MYC",
projection = "grch37",
raw = TRUE)), 1)

expect_equal(nrow(get_gene_info(these_genes = "MYC",
projection = "hg38",
raw = TRUE)), 1)

expect_equal(ncol(get_gene_info(these_genes = "MYC",
projection = "grch37",
raw = TRUE)), 26)

expect_equal(ncol(get_gene_info(these_genes = "MYC",
projection = "hg38",
raw = TRUE)), 26)

expect_equal(ncol(get_gene_info(these_genes = "MYC",
projection = "grch37",
raw = FALSE)), 19)

expect_equal(ncol(get_gene_info(these_genes = "MYC",
projection = "hg38",
raw = FALSE)), 19)
})


test_that("Expected to fail", {
expect_error(get_gene_info(raw = TRUE))
expect_error(get_gene_info(these_genes = "MYC",
projection = "hg19"))
})

0 comments on commit 1f30f86

Please sign in to comment.