require 'test/unit'
require 'phi'

class TCDateTime < Test::Unit::TestCase
  def test_1
    c = Phi::DateTime
    assert_respond_to c, :now
    assert c.now
  end

  def test_2
    t = Phi::DateTime.new(2005,3,5,9,15,30)
    assert_equal 2005, t.year
    assert_equal 3, t.month
    assert_equal 5, t.day
    assert_equal 9, t.hour
    assert_equal 15, t.minute
    assert_equal 30, t.second
    t1 = t.inc_year
    assert_equal 2005, t.year
    assert_equal 2006, t1.year
    #t0 = t.inc_year(-1)
    #assert_equal 2005, t.year
    #assert_equal 2004, t0.year
    t0 = t.inc_month(-1)
    assert_equal 3, t.month
    assert_equal 2, t0.month
  end
end
