-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
228 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package test; | ||
|
||
import com.nlf.calendar.Lunar; | ||
import com.nlf.calendar.Solar; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* 六曜测试 | ||
* | ||
* @author 6tail | ||
*/ | ||
public class LiuYaoTest { | ||
|
||
@Test | ||
public void test1(){ | ||
Solar solar = new Solar(2020,4,23); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(lunar.toString(),"佛灭",lunar.getLiuYao()); | ||
} | ||
|
||
@Test | ||
public void test2(){ | ||
Solar solar = new Solar(2021,1,15); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(lunar.toString(),"友引",lunar.getLiuYao()); | ||
} | ||
|
||
@Test | ||
public void test3(){ | ||
Solar solar = new Solar(2017,1,5); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(lunar.toString(),"先胜",lunar.getLiuYao()); | ||
} | ||
|
||
@Test | ||
public void test4(){ | ||
Solar solar = new Solar(2020,4,10); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(lunar.toString(),"友引",lunar.getLiuYao()); | ||
} | ||
|
||
@Test | ||
public void test5(){ | ||
Solar solar = new Solar(2020,6,11); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(lunar.toString(),"大安",lunar.getLiuYao()); | ||
} | ||
|
||
@Test | ||
public void test6(){ | ||
Solar solar = new Solar(2020,6,1); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(lunar.toString(),"先胜",lunar.getLiuYao()); | ||
} | ||
|
||
@Test | ||
public void test7(){ | ||
Solar solar = new Solar(2020,12,8); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(lunar.toString(),"先负",lunar.getLiuYao()); | ||
} | ||
|
||
@Test | ||
public void test8(){ | ||
Solar solar = new Solar(2020,12,11); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(lunar.toString(),"赤口",lunar.getLiuYao()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package test; | ||
|
||
import com.nlf.calendar.Lunar; | ||
import com.nlf.calendar.Solar; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
|
||
/** | ||
* 物候测试 | ||
* | ||
* @author 6tail | ||
*/ | ||
public class WuHouTest { | ||
|
||
@Test | ||
public void test1(){ | ||
Solar solar = new Solar(2020,4,23); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(solar.toString(),"萍始生",lunar.getWuHou()); | ||
} | ||
|
||
@Test | ||
public void test2(){ | ||
Solar solar = new Solar(2021,1,15); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(solar.toString(),"雉始雊",lunar.getWuHou()); | ||
} | ||
|
||
@Test | ||
public void test3(){ | ||
Solar solar = new Solar(2017,1,5); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(solar.toString(),"雁北乡",lunar.getWuHou()); | ||
} | ||
|
||
@Test | ||
public void test4(){ | ||
Solar solar = new Solar(2020,4,10); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(solar.toString(),"田鼠化为鴽",lunar.getWuHou()); | ||
} | ||
|
||
@Test | ||
public void test5(){ | ||
Solar solar = new Solar(2020,6,11); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(solar.toString(),"鵙始鸣",lunar.getWuHou()); | ||
} | ||
|
||
@Test | ||
public void test6(){ | ||
Solar solar = new Solar(2020,6,1); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(solar.toString(),"麦秋至",lunar.getWuHou()); | ||
} | ||
|
||
@Test | ||
public void test7(){ | ||
Solar solar = new Solar(2020,12,8); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(solar.toString(),"鹖鴠不鸣",lunar.getWuHou()); | ||
} | ||
|
||
@Test | ||
public void test8(){ | ||
Solar solar = new Solar(2020,12,11); | ||
Lunar lunar = solar.getLunar(); | ||
Assert.assertEquals(solar.toString(),"鹖鴠不鸣",lunar.getWuHou()); | ||
} | ||
|
||
} |