/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ir.sjb.jalcal.util;

import java.util.Calendar;
import org.junit.Test;
import static org.fest.assertions.Assertions.*;

/**
 *
 * @author sjb
 */
public class JalCalTest {

    @Test
    public void testJalaliToGregorian() throws DateException {
        assertThat(JalCal.jalaliToGregorian(1393, 5, 14, 10, 2, 4).toInstant().toString()).isEqualTo("2014-08-05T05:32:04Z");
    }

    @Test
    public void testGregorianToJalali() throws DateException {
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.DAY_OF_MONTH, 5);
        cal.set(Calendar.MONTH, 6);
        cal.set(Calendar.YEAR, 2014);
        cal.set(Calendar.HOUR_OF_DAY, 10);
        cal.set(Calendar.MINUTE, 25);
        cal.set(Calendar.SECOND, 1);
        cal.set(Calendar.MILLISECOND, 0);
        assertThat(JalCal.gregorianToJalali(cal.getTime())).isEqualTo("14/4/1393   10:25:1");
    }

}

@@ -234,16 +234,39 @@
 lendar;%0A
+import java.util.Date;%0A
 import o
@@ -280,16 +280,16 @@
 t.Test;%0A
-
 import s
@@ -526,64 +526,338 @@
  4).
-toInstant().toString()).isEqualTo(%222014-08-05T05:32:04Z%22
+getTime()).isEqualTo(1407216724000l);%0A        assertThat(JalCal.jalaliToGregorian(1393, 5, 14, 12, 1, 1).getTime()).isEqualTo(1407223861000l);%0A        assertThat(JalCal.jalaliToGregorian(%221393/5/14%22).getTime()).isEqualTo(1407180600000l);%0A        assertThat(JalCal.jalaliToGregorian(%2214/5/1393%22).getTime()).isEqualTo(1407180600000l
 );%0A 
@@ -1255,24 +1255,24 @@
 SECOND, 0);%0A
-
         asse
@@ -1316,16 +1316,22 @@
 etTime()
+, true
 )).isEqu

Update JalCalTest.java