Sha256: 5bd75a5f854c21ffe6c5ecfa1ff20c95183f036e29f19c6740bed4ed7c5c3e18
Contents?: true
Size: 1.84 KB
Versions: 1
Compression:
Stored size: 1.84 KB
Contents
# MdTranslator - minitest of # reader / mdJson / module_browseGraphic # History: # Stan Smith 2014-12-24 original script require 'minitest/autorun' require 'json' require 'adiwg/mdtranslator/internal/internal_metadata_obj' require 'adiwg/mdtranslator/readers/mdJson/modules_0.9/module_browseGraphic' class TestReaderMdJsonBrowseGraphic_v0_9 < MiniTest::Test # get json test example file = File.open('test/schemas/v0_9/examples/graphicOverview.json', 'r') jsonFile = file.read file.close aIn = JSON.parse(jsonFile) @@hIn = aIn[0] # set namespace @@NameSpace = ADIWG::Mdtranslator::Readers::MdJson::BrowseGraphic def test_complete_browseGraphic_object hIn = @@hIn.clone intObj = { bGName: 'fileName', bGDescription: 'fileDescription', bGType: 'fileType', bGURI: 'http://thisisanexample.com' } assert_equal intObj, @@NameSpace.unpack(hIn) end def test_missing_browseGraphic_elements # except for fileName hIn = @@hIn.clone hIn.delete('fileDescription') hIn.delete('fileType') hIn.delete('fileUri') intObj = { bGName: 'fileName', bGDescription: nil, bGType: nil, bGURI: nil } assert_equal intObj,@@NameSpace.unpack(hIn) end def test_empty_browseGraphic_elements hIn = @@hIn.clone hIn['fileName'] = '' hIn['fileDescription'] = '' hIn['fileType'] = '' hIn['fileUri'] = '' intObj = { bGName: nil, bGDescription: nil, bGType: nil, bGURI: nil } assert_equal intObj,@@NameSpace.unpack(hIn) end def test_empty_browseGraphic_object hIn = {} assert_equal nil, @@NameSpace.unpack(hIn) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
adiwg-mdtranslator-0.12.1 | test/readers/mdJson/v0_9/tc_reader_mdjson_browseGraphic.rb |