1
0
mirror of synced 2026-10-19 04:56:11 +08:00

v1.2.27 修复立春比春节早时年九星的错误;新增阳历月中获取周。

This commit is contained in:
6tail
2022-11-25 20:58:49 +08:00
parent 51afe36b4b
commit 12a8eec123
9 changed files with 79 additions and 23 deletions

View File

@@ -258,6 +258,14 @@ public class BaZiTest {
}
}
@Test
public void testBaZi2Solar1() {
List<Solar> l = Solar.fromBaZi("壬寅","庚戌","己未","乙亥");
for(Solar s:l){
System.out.println(s.toFullString());
}
}
@Test
public void test4() {
Lunar lunar = Lunar.fromYmd(1985, 12, 27);
@@ -295,4 +303,14 @@ public class BaZiTest {
Assert.assertEquals("日柱", "庚子", eightChar.getDay());
Assert.assertEquals("时柱", "戊子", eightChar.getTime());
}
@Test
public void test13(){
Lunar lunar = Lunar.fromYmdHms(1991, 4, 5, 3, 37, 0);
EightChar eightChar = lunar.getEightChar();
Assert.assertEquals("年柱", "辛未", eightChar.getYear());
Assert.assertEquals("月柱", "癸巳", eightChar.getMonth());
Assert.assertEquals("日柱", "戊子", eightChar.getDay());
Assert.assertEquals("时柱", "甲寅", eightChar.getTime());
}
}

View File

@@ -161,18 +161,6 @@ public class LunarTest {
Assert.assertEquals("2033-12-22", lunar.getSolar().toYmd());
}
@Test
public void test23() {
Lunar lunar = Lunar.fromYmd(2022, 1, 1);
Assert.assertEquals("六白金开阳", lunar.getYearNineStar().toString());
}
@Test
public void test24() {
Lunar lunar = Lunar.fromYmd(2033, 1, 1);
Assert.assertEquals("四绿木天权", lunar.getYearNineStar().toString());
}
@Test
public void test25() {
Solar solar = new Solar(2021, 6, 7, 21, 18, 0);

View File

@@ -0,0 +1,26 @@
package test;
import com.nlf.calendar.Lunar;
import com.nlf.calendar.Solar;
import org.junit.Assert;
import org.junit.Test;
public class NineStarTest {
@Test
public void test1() {
Lunar lunar = Solar.fromYmd(1985, 2, 19).getLunar();
Assert.assertEquals("六", lunar.getYearNineStar().getNumber());
}
@Test
public void test2() {
Lunar lunar = Lunar.fromYmd(2022, 1, 1);
Assert.assertEquals("六白金开阳", lunar.getYearNineStar().toString());
}
@Test
public void test3() {
Lunar lunar = Lunar.fromYmd(2033, 1, 1);
Assert.assertEquals("四绿木天权", lunar.getYearNineStar().toString());
}
}