# test_ISOTelephone.R # Author: Emmanuel Blondel # # Description: Unit tests for ISOTelephone.R #======================= require(geometa, quietly = TRUE) require(testthat) context("ISOTelephone") test_that("encoding",{ testthat::skip_on_cran() #encoding md <- ISOTelephone$new() md$setVoice("myphonenumber") md$setFacsimile("myfacsimile") xml <- md$encode() expect_is(xml, "XMLInternalNode") #decoding md2 <- ISOTelephone$new(xml = xml) xml2 <- md2$encode() expect_true(ISOAbstractObject$compare(md, md2)) }) test_that("encoding",{ testthat::skip_on_cran() #encoding md <- ISOTelephone$new() md$setVoice( "myphonenumber", locales = list( EN = "myphonenumber in UK", FR = "mon numéro en France", ES = "mi número en España", AR = "رقم هاتفي في المملكة العربية السعودية", RU = "мой номер телефона в России", ZH = "我在中国的电话号码" ) ) md$setFacsimile( "myfacsimile", locales = list( EN = "mi facsimile in UK", FR = "mon fax en France", ES = "mi fax en España", AR = "فاكس بلدي في المملكة العربية السعودية", RU = "мой факс в россии", ZH = "我在中国的传真" ) ) xml <- md$encode() expect_is(xml, "XMLInternalNode") #decoding md2 <- ISOTelephone$new(xml = xml) xml2 <- md2$encode() expect_true(ISOAbstractObject$compare(md, md2)) })