Codebase list ruby-fxruby / 22d2a9a8-6c7c-467e-8f0b-1e158ed8c421/main test / TC_FXRegistry.rb
22d2a9a8-6c7c-467e-8f0b-1e158ed8c421/main

Tree @22d2a9a8-6c7c-467e-8f0b-1e158ed8c421/main (Download .tar.gz)

TC_FXRegistry.rb @22d2a9a8-6c7c-467e-8f0b-1e158ed8c421/mainraw · history · blame

require 'test/unit'
require 'fox16'

class TC_FXRegistry < Test::Unit::TestCase
  include Fox

  def setup
    @reg = FXRegistry.new("TC_FXRegistry", "FXRuby")
  end

  def test_boolEntries
    assert(@reg.writeBoolEntry("SETTINGS", "trueEntry", true))
    assert(@reg.writeBoolEntry("SETTINGS", "falseEntry", false))

    assert(@reg.readBoolEntry("SETTINGS", "trueEntry"))
    assert(@reg.readBoolEntry("SETTINGS", "trueEntry", true))
    assert(@reg.readBoolEntry("SETTINGS", "trueEntry", false))

    assert(!@reg.readBoolEntry("SETTINGS", "falseEntry"))
    assert(!@reg.readBoolEntry("SETTINGS", "falseEntry", true))
    assert(!@reg.readBoolEntry("SETTINGS", "falseEntry", false))

    assert(!@reg.readBoolEntry("SETTINGS", "missingEntry"))
    assert(!@reg.readBoolEntry("SETTINGS", "missingEntry", false))
    assert( @reg.readBoolEntry("SETTINGS", "missingEntry", true))
  end
end