# test_ISOMemberName.R # Author: Emmanuel Blondel # # Description: Unit tests for ISOMemberName.R #======================= require(geometa, quietly = TRUE) require(testthat) context("ISOMemberName") test_that("encoding",{ testthat::skip_on_cran() #encoding md <- ISOMemberName$new(aName = "name", attributeType = "type") expect_is(md, "ISOMemberName") xml <- md$encode() expect_is(xml, "XMLInternalNode") #decoding md2 <- ISOMemberName$new(xml = xml) xml2 <- md2$encode() expect_true(ISOAbstractObject$compare(md, md2)) }) test_that("encoding - i18n",{ testthat::skip_on_cran() #encoding md <- ISOMemberName$new() md$setName( "name", locales = list( EN = "name in english", FR = "nom en français", ES = "Nombre en español", AR = "الاسم باللغة العربية", RU = "имя на русском", ZH = "中文名" )) md$setAttributeType("type") expect_is(md, "ISOMemberName") xml <- md$encode() expect_is(xml, "XMLInternalNode") #decoding md2 <- ISOMemberName$new(xml = xml) xml2 <- md2$encode() expect_true(ISOAbstractObject$compare(md, md2)) })