Sha256: 2f44f4f168d53e977ffa798d6a88acba674feda6ce582c5b001515ca685b75d5

Contents?: true

Size: 774 Bytes

Versions: 3

Compression:

Stored size: 774 Bytes

Contents

require 'test/unit'
require 'rubygems'
require 'rubeus'

# Test for setter.rb
class TestSetter < Test::Unit::TestCase
  include Rubeus::Swing

  # setup method
  def setup
  end

  # test set_preferred_size
  def test_set_preferred_size
    JFrame.new do |f|
      txt = JTextField.new
      txt.set_preferred_size "100 x 150"

      f.pack

      assert_equal(100, txt.get_preferred_size.width)
      assert_equal(150, txt.get_preferred_size.height)

      f.dispose
    end
  end

  # test preferred_size=
  def test_preferred_size=
    JFrame.new do |f|
      txt = JTextField.new
      txt.preferred_size = "150 x 100"

      f.pack

      assert_equal(150, txt.preferred_size.width)
      assert_equal(100, txt.preferred_size.height)

      f.dispose
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubeus-0.0.9-java test/rubeus/awt/test_setter.rb
rubeus-0.0.8-java test/rubeus/awt/test_setter.rb
rubeus-0.0.7-java test/rubeus/awt/test_setter.rb