tests/testthat/test-creating-Matrix-Function.R

test_that("returns error if creatingMatrix receives a non numeric matchCost", {
    matchCost <- "a malevolent string"
    expect_error(creatingMatrix(matchCost,-3,-4,"GTT","GCATT"))
})

test_that("returns error if creatingMatrix receives a non numeric mismatchCost", {
    mismatchCost <- "a malevolent string"
    expect_error(creatingMatrix(7,mismatchCost,-4,"GTT","GCATT"))
})

test_that("returns error if creatingMatrix receives a non numeric gapPenalty", {
    gapPenalty <- "a malevolent string"
    expect_error(creatingMatrix(7,-3,gapPenalty,"GTT","GCATT"))
})

test_that("returns error if creatingMatrix receives a non string sequenceA", {
    sequenceA <- 1
    expect_error(creatingMatrix(7,-3,-4,sequenceA,"GCATT"))
})

test_that("returns error if creatingMatrix receives a non string sequenceB", {
    sequenceB <- 1
    expect_error(creatingMatrix(7,-3,-4,"GTT",sequenceB))
})

test_that("returns error if creatingMatrix receives a NULL string as a sequenceA", {
    sequenceA <- NULL
    expect_error(creatingMatrix(7,-3,-4,sequenceA,"GCATT"))
})

test_that("returns error if creatingMatrix receives an empty string as a sequenceB", {
    sequenceB <- ""
    expect_error(creatingMatrix(7,-3,-4,"GTT",sequenceB))
})
BeatriceBa/RProjectNW documentation built on Dec. 17, 2021, 10:47 a.m.