package org.josast.util.date;

import org.josast.util.date.GenericDate;

import junit.framework.TestCase;


/**
 * DOCUMENT ME!
 *
 * @author $author$
 * @version $Revision: 1.1 $
 */
public class GenericDateTest extends TestCase {
    //~ Constructors ------------------------------------------------------

    /**
     * Creates a new GenericDateTest object.
     *
     * @param arg0 DOCUMENT ME!
     */
    public GenericDateTest(String arg0) {
        super(arg0);
    }

    //~ Methods -----------------------------------------------------------

    /**
     * <br> create a date with Generic Date with Date, Month, Day ..
     * <br> compare to the expected Julian Day
     * <br> create a date with Generic date with Julian Day value
     * <br> compare to the expected Julian Day
     */
    public void testGetJulianDay() {
        GenericDate Gd = new GenericDate(1950, 5, 19, 22, 30, 00);
        GenericDateTest.assertEquals(2433421.4375, Gd.getJulianDay(), 0);

        GenericDate Gd2 = new GenericDate(2433421.4375);
        GenericDateTest.assertEquals(2433421.4375, Gd2.getJulianDay(), 0);
        GenericDateTest.assertEquals(1950, Gd2.get_year());
        GenericDateTest.assertEquals(5, Gd2.get_month());
        GenericDateTest.assertEquals(19, Gd2.get_day());
        GenericDateTest.assertEquals(22, Gd2.get_hour());
        GenericDateTest.assertEquals(30, Gd2.get_minute());
        GenericDateTest.assertEquals(00, Gd2.get_seconde());
    }
}
