v1.3.4 LunarMonth增加序号、干支、财神方位等;完善纪念日。
This commit is contained in:
@@ -5,6 +5,9 @@ import com.nlf.calendar.Lunar;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 佛历测试
|
||||
*
|
||||
@@ -28,4 +31,12 @@ public class FotoTest {
|
||||
Assert.assertEquals("青龙", foto.getShou());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2() {
|
||||
Foto foto = Foto.fromLunar(Lunar.fromYmd(2021, 3, 16));
|
||||
List<String> expected = new ArrayList<String>();
|
||||
expected.add("准提菩萨圣诞");
|
||||
Assert.assertEquals(expected, foto.getOtherFestivals());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
56
src/test/java/test/LunarMonthTest.java
Normal file
56
src/test/java/test/LunarMonthTest.java
Normal file
@@ -0,0 +1,56 @@
|
||||
package test;
|
||||
|
||||
import com.nlf.calendar.LunarMonth;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* 农历月测试
|
||||
*
|
||||
* @author 6tail
|
||||
*/
|
||||
public class LunarMonthTest {
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
LunarMonth month = LunarMonth.fromYm(2023, 1);
|
||||
Assert.assertEquals(1, month.getIndex());
|
||||
Assert.assertEquals("甲寅", month.getGanZhi());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test1(){
|
||||
LunarMonth month = LunarMonth.fromYm(2023, -2);
|
||||
Assert.assertEquals(3, month.getIndex());
|
||||
Assert.assertEquals("丙辰", month.getGanZhi());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2(){
|
||||
LunarMonth month = LunarMonth.fromYm(2023, 3);
|
||||
Assert.assertEquals(4, month.getIndex());
|
||||
Assert.assertEquals("丁巳", month.getGanZhi());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3(){
|
||||
LunarMonth month = LunarMonth.fromYm(2024, 1);
|
||||
Assert.assertEquals(1, month.getIndex());
|
||||
Assert.assertEquals("丙寅", month.getGanZhi());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test4(){
|
||||
LunarMonth month = LunarMonth.fromYm(2023, 12);
|
||||
Assert.assertEquals(13, month.getIndex());
|
||||
Assert.assertEquals("丙寅", month.getGanZhi());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test5(){
|
||||
LunarMonth month = LunarMonth.fromYm(2022, 1);
|
||||
Assert.assertEquals(1, month.getIndex());
|
||||
Assert.assertEquals("壬寅", month.getGanZhi());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user