tests/testthat_disabled/test-avisSpeciesId.R

context("avisSpeciesId")

# TODO: base on mocked .avisApiBusOrden

test_that("Correct species name is loaded", { 

  	nameraw <- "Pica pica"

  	expectedId <- 480

  	expect_is(avisSpeciesId (nameraw), "integer")
  	expect_identical (avisSpeciesId (nameraw), as.integer (expectedId))
})

test_that("Wrong species name throws an error", { 

	expect_error (avisSpeciesId ("Unexistent especies"))
})

Try the rAvis package in your browser

Any scripts or data that you put into this service are public.

rAvis documentation built on May 2, 2019, 3:28 p.m.