Skip to content

Commit

Permalink
#181 further testing on ISOMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
eblondel committed Dec 12, 2024
1 parent 1fb0f3d commit d5b3e56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
9 changes: 6 additions & 3 deletions R/ISOReferenceIdentifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ ISOReferenceIdentifier <- R6Class("ISOReferenceIdentifier",
inherit = ISOAbstractObject,
private = list(
xmlElement = "RS_Identifier",
xmlNamespacePrefix = "GMD"
xmlNamespacePrefix = list(
"19139"= "GMD"
)
),
public = list(

Expand All @@ -37,8 +39,9 @@ ISOReferenceIdentifier <- R6Class("ISOReferenceIdentifier",
#'@param xml object of class \link{XMLInternalNode-class}
#'@param code code
#'@param codeSpace code space
initialize = function(xml = NULL, code, codeSpace = NULL){
self$setCode(code)
initialize = function(xml = NULL, code = NULL, codeSpace = NULL){
super$initialize(xml = xml)
if(!is.null(code)) self$setCode(code)
if(!is.null(codeSpace)) self$setCodeSpace(codeSpace)
},

Expand Down
10 changes: 5 additions & 5 deletions tests/testthat/test_ISOMetadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ test_that("encoding/decoding",{
dq <- ISODataQuality$new()

#add scope
scope <- ISOScopeCode$new()
scope <- ISODataQualityScope$new()
scope$setLevel("dataset")
dq$setScope(scope)

Expand Down Expand Up @@ -922,7 +922,7 @@ test_that("encoding/decoding - i18n",{
dq <- ISODataQuality$new()

#add scope
scope <- ISOScopeCode$new()
scope <- ISODataQualityScope$new()
scope$setLevel("dataset")
dq$setScope(scope)

Expand Down Expand Up @@ -1085,7 +1085,7 @@ test_that("encoding/decoding - ISO 19115-3",{
sms$setNumberType("sms")
contact$addPhone(sms)
address <- ISOAddress$new()
address$setDeliveryPoint("theaddress")
address$addDeliveryPoint("theaddress")
address$setCity("thecity")
address$setPostalCode("111")
address$setCountry("France")
Expand Down Expand Up @@ -1180,7 +1180,7 @@ test_that("encoding/decoding - ISO 19115-3",{
phone$setNumberType("voice")
contact$addPhone(phone)
address <- ISOAddress$new()
address$setDeliveryPoint("theaddress")
address$addDeliveryPoint("theaddress")
address$setCity("thecity")
address$setPostalCode("111")
address$setCountry("France")
Expand Down Expand Up @@ -1407,7 +1407,7 @@ test_that("encoding/decoding - ISO 19115-3",{
md2 <- ISOMetadata$new(xml = xml)
xml2 <- md2$encode()

elapsed_with_print_comparator <- system.time(expect_true(ISOAbstractObject$compare(md, md2)))[["elapsed"]]
elapsed_with_print_comparator <- system.time(expect_true(ISOAbstractObject$compare(md, md2)))[["elapsed"]] #NOT OK FOR NOW, issue With Telephone
setGeometaOption("object_comparator", "xml")
elapsed_with_xml_comparator <- system.time(expect_true(ISOAbstractObject$compare(md, md2)))[["elapsed"]]
setGeometaOption("object_comparator", "print")
Expand Down

0 comments on commit d5b3e56

Please sign in to comment.