1
0
mirror of synced 2026-10-15 02:56:11 +08:00

v1.2.20 支持获取当年第几周;支持2种流派获取起运。

This commit is contained in:
6tail
2022-03-12 20:05:14 +08:00
parent 1a15531fb4
commit 249aa36176
8 changed files with 148 additions and 26 deletions

View File

@@ -71,4 +71,16 @@ public class SolarWeekTest {
Assert.assertEquals(2, week.getIndex());
}
@Test
public void test10() {
SolarWeek week = SolarWeek.fromYmd(2022, 3, 6, 0);
Assert.assertEquals(11, week.getIndexInYear());
}
@Test
public void test11() {
SolarWeek week = SolarWeek.fromYmd(2022, 3, 6, 1);
Assert.assertEquals(10, week.getIndexInYear());
}
}

View File

@@ -53,4 +53,34 @@ public class YunTest {
Assert.assertEquals("起运阳历", "2020-02-06", yun.getStartSolar().toYmd());
}
@Test
public void test4() {
Solar solar = new Solar(2022, 3, 9, 20, 51, 0);
Lunar lunar = solar.getLunar();
EightChar eightChar = lunar.getEightChar();
Yun yun = eightChar.getYun(1);
Assert.assertEquals("起运阳历", "2030-12-19", yun.getStartSolar().toYmd());
}
@Test
public void test5() {
Solar solar = new Solar(2022, 3, 9, 20, 51, 0);
Lunar lunar = solar.getLunar();
EightChar eightChar = lunar.getEightChar();
Yun yun = eightChar.getYun(1, 2);
Assert.assertEquals("起运年数", 8, yun.getStartYear());
Assert.assertEquals("起运月数", 9, yun.getStartMonth());
Assert.assertEquals("起运天数", 2, yun.getStartDay());
Assert.assertEquals("起运阳历", "2030-12-12", yun.getStartSolar().toYmd());
}
@Test
public void test6() {
Solar solar = new Solar(2018, 6, 11, 9, 30, 0);
Lunar lunar = solar.getLunar();
EightChar eightChar = lunar.getEightChar();
Yun yun = eightChar.getYun(0, 2);
Assert.assertEquals("起运阳历", "2020-03-21", yun.getStartSolar().toYmd());
}
}