require 'test/unit'

require 'fox'

include Fox

class TC_FXRegion < Test::Unit::TestCase
  def setup
    @region = FXRegion.new(5, 5, 10, 10)
  end
  def test_copy_constructor
    assert_equal(@region, FXRegion.new(@region))
  end
  def test_empty
    assert(!@region.empty?)
    empty_region = FXRegion.new(5, 5, 0, 0)
    assert(empty_region.empty?)
  end
  def test_containsPoint
    # Definitely out of bounds
    assert(!@region.contains?(2, 3))

    # Definitely in bounds    
    assert(@region.contains?(6, 6))

    # Check corners too
    assert(@region.contains?(5, 5))
    assert(@region.contains?(5, 14))
    assert(@region.contains?(14, 14))
    assert(@region.contains?(14, 5))
  end
  def test_containsRectangle
    assert(@region.contains?(2, 3, 15, 15)) # why doesn't this fail?
    assert(@region.contains?(5, 5, 10, 10))
    assert(@region.contains?(6, 6, 5, 5))
  end
  def test_bounds
  end
  def test_offset
  end
  def test_union
  end
  def test_intersect
  end
  def test_subtract
  end
  def test_xor
  end
  def test_equal
  end
end
