MCPcopy Create free account
hub / github.com/6tail/lunar-java / test

Method test

src/test/java/sample/YearTest.java:14–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12public class YearTest {
13
14 @Test
15 public void test(){
16 //明年
17 SolarYear year = new SolarYear().next(1);
18 System.out.println("==="+year.getYear()+"年===");
19 //遍历明年的每个月
20 for(SolarMonth m:year.getMonths()){
21 System.out.println("---"+m.getMonth()+"月---");
22 //遍历当月的每一天
23 for(Solar d:m.getDays()){
24 //获取阴历
25 Lunar lunar = d.getLunar();
26 String s = (d.getDay() < 10 ? "0" : "") +
27 d.getDay() +
28 " " +
29 lunar.getMonthInChinese() +
30 "月" +
31 lunar.getDayInChinese() +
32 " " +
33 "星期" +
34 d.getWeekInChinese() +
35 " " +
36 d.getFestivals() +
37 lunar.getFestivals() +
38 lunar.getJie() +
39 lunar.getQi();
40 System.out.println(s);
41 }
42 }
43 }
44
45}

Callers

nothing calls this directly

Calls 14

getYearMethod · 0.95
getMonthsMethod · 0.95
getMonthInChineseMethod · 0.95
getDayInChineseMethod · 0.95
getFestivalsMethod · 0.95
getJieMethod · 0.95
getQiMethod · 0.95
nextMethod · 0.45
getMonthMethod · 0.45
getDaysMethod · 0.45
getLunarMethod · 0.45
getDayMethod · 0.45

Tested by

no test coverage detected