tests/testthat/test-parameter.R

# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate

context("Test Parameter")

model.instance <- Parameter$new()

ref.json <- '{
        "id" : null,
        "cv_label" : "MSIO",
        "cv_accession" : "MSIO:0000148",
        "name" : "high performance liquid chromatography",
        "value" : null
      }'

test_that("parameter from and toJSONString works", {
  
  model.instance <- model.instance$fromJSONString(ref.json)
  expect_equal(model.instance$`id`, NULL)
  expect_equal(model.instance$`cv_label`, "MSIO")
  expect_equal(model.instance$`cv_accession`, "MSIO:0000148")
  expect_equal(model.instance$`name`, "high performance liquid chromatography")
  expect_equal(model.instance$`value`, NULL)
  
  restored.model.instance <- Parameter$new()
  restored.model.instance$fromJSONString(model.instance$toJSONString())
  expect_equal(model.instance, restored.model.instance)
})
lifs-tools/rmzTab-m documentation built on Jan. 26, 2023, 4:45 p.m.