tests/testthat/test_SWENilValues.R

# test_SWENilValues.R
# Author: Emmanuel Blondel <emmanuel.blondel1@gmail.com>
#
# Description: Unit tests for classes inheriting SWENilValues.R
#=======================
require(geometa, quietly = TRUE)
require(sf)
require(testthat)

context("SWENilValues")

test_that("SWENilValues",{
  testthat::skip_on_cran()
  #encoding
  nil <- SWENilValues$new()
  nil$addNilValue(1,"unknown")
  nil$addNilValue(2,"unknown")
  xml <- nil$encode()
  expect_is(xml, "XMLInternalNode")
  #decoding
  nil2 <- SWENilValues$new(xml = xml)
  xml2 <- nil2$encode()
  #assert object identity
  expect_true(ISOAbstractObject$compare(nil, nil2))
})

Try the geometa package in your browser

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

geometa documentation built on May 29, 2024, 10:31 a.m.