v1.3.8 修复星期错误的问题;修正逐日胎神数据。
This commit is contained in:
@@ -53,4 +53,10 @@ public class LunarMonthTest {
|
||||
Assert.assertEquals("壬寅", month.getGanZhi());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test6(){
|
||||
LunarMonth month = LunarMonth.fromYm(2023, 9);
|
||||
Assert.assertEquals("癸亥", month.getGanZhi());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ public class LunarTest {
|
||||
public void test52() {
|
||||
Solar solar = Solar.fromYmd(2011, 11, 12);
|
||||
Lunar lunar = solar.getLunar();
|
||||
Assert.assertEquals("厕灶厨 外西南", lunar.getDayPositionTai());
|
||||
Assert.assertEquals("厨灶厕 外西南", lunar.getDayPositionTai());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -645,4 +645,10 @@ public class LunarTest {
|
||||
Assert.assertEquals("九一七年冬月十六", lunar.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test95() {
|
||||
Lunar lunar = Solar.fromYmd(2023, 10, 30).getLunar();
|
||||
Assert.assertEquals("闭", lunar.getZhiXing());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package test;
|
||||
|
||||
import com.nlf.calendar.Lunar;
|
||||
import com.nlf.calendar.LunarMonth;
|
||||
import com.nlf.calendar.LunarYear;
|
||||
import com.nlf.calendar.Solar;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
@@ -10,17 +12,69 @@ public class NineStarTest {
|
||||
public void test1() {
|
||||
Lunar lunar = Solar.fromYmd(1985, 2, 19).getLunar();
|
||||
Assert.assertEquals("六", lunar.getYearNineStar().getNumber());
|
||||
Assert.assertEquals("五黄土玉衡", lunar.getDayNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2() {
|
||||
Lunar lunar = Lunar.fromYmd(2022, 1, 1);
|
||||
Assert.assertEquals("六白金开阳", lunar.getYearNineStar().toString());
|
||||
Assert.assertEquals("四绿木天权", lunar.getDayNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3() {
|
||||
Lunar lunar = Lunar.fromYmd(2033, 1, 1);
|
||||
Assert.assertEquals("四绿木天权", lunar.getYearNineStar().toString());
|
||||
Assert.assertEquals("一白水天枢", lunar.getDayNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test4() {
|
||||
LunarYear y = LunarYear.fromYear(1985);
|
||||
Assert.assertEquals("六白金开阳", y.getNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test5() {
|
||||
LunarYear y = LunarYear.fromYear(2022);
|
||||
Assert.assertEquals("五黄土玉衡", y.getNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test6() {
|
||||
LunarYear y = LunarYear.fromYear(2033);
|
||||
Assert.assertEquals("三碧木天玑", y.getNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test7() {
|
||||
LunarMonth m = LunarMonth.fromYm(1985, 2);
|
||||
Assert.assertEquals("四绿木天权", m.getNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test8() {
|
||||
LunarMonth m = LunarMonth.fromYm(2022, 1);
|
||||
Assert.assertEquals("二黒土天璇", m.getNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test9() {
|
||||
LunarMonth m = LunarMonth.fromYm(2033, 1);
|
||||
Assert.assertEquals("五黄土玉衡", m.getNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test10() {
|
||||
Lunar d = Lunar.fromYmdHms(2033, 1, 1, 12, 0,0);
|
||||
Assert.assertEquals("七赤金摇光", d.getTimeNineStar().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test11() {
|
||||
Lunar d = Lunar.fromYmdHms(2011, 5, 3, 23, 0,0);
|
||||
Assert.assertEquals("七赤金摇光", d.getTimeNineStar().toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,4 +54,47 @@ public class WeekTest {
|
||||
Solar solar = Solar.fromYmd(1582, 10, 15);
|
||||
Assert.assertEquals(5, solar.getWeek());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test3(){
|
||||
Solar solar = Solar.fromYmd(1129, 11, 17);
|
||||
Assert.assertEquals(0, solar.getWeek());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test4(){
|
||||
Solar solar = Solar.fromYmd(1129, 11, 1);
|
||||
Assert.assertEquals(5, solar.getWeek());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test5(){
|
||||
Solar solar = Solar.fromYmd(8, 11, 1);
|
||||
Assert.assertEquals(4, solar.getWeek());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test6(){
|
||||
Solar solar = Solar.fromYmd(1582, 9, 30);
|
||||
Assert.assertEquals(0, solar.getWeek());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test7(){
|
||||
Solar solar = Solar.fromYmd(1582, 1, 1);
|
||||
Assert.assertEquals(1, solar.getWeek());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test8(){
|
||||
Solar solar = Solar.fromYmd(1500, 2, 29);
|
||||
Assert.assertEquals(6, solar.getWeek());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test9(){
|
||||
Solar solar = Solar.fromYmd(9865, 7, 26);
|
||||
Assert.assertEquals(3, solar.getWeek());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user