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

Method testQiYun

src/test/java/sample/BaZiTestNew.java:148–212  ·  view source on GitHub ↗

起运

()

Source from the content-addressed store, hash-verified

146 * 起运
147 */
148 @Test
149 public void testQiYun() {
150 Solar solar = new Solar(1983, 2, 15, 20, 0, 0);
151 Lunar lunar = solar.getLunar();
152 EightChar bazi = lunar.getEightChar();
153 Yun yun = bazi.getYun(0);
154 Assert.assertEquals(6, yun.getStartYear());
155 Assert.assertEquals(2, yun.getStartMonth());
156 Assert.assertEquals(20, yun.getStartDay());
157 Assert.assertEquals("1989-05-05", yun.getStartSolar().toYmd());
158
159 solar = new Solar(2013, 7, 13, 16, 17, 0);
160 lunar = solar.getLunar();
161 bazi = lunar.getEightChar();
162 yun = bazi.getYun(0);
163 Assert.assertEquals(8, yun.getStartYear());
164 Assert.assertEquals(4, yun.getStartMonth());
165 Assert.assertEquals(0, yun.getStartDay());
166 Assert.assertEquals("2021-11-13", yun.getStartSolar().toYmd());
167
168 solar = new Solar(2020, 8, 18, 10, 0, 0);
169 lunar = solar.getLunar();
170 bazi = lunar.getEightChar();
171 yun = bazi.getYun(0);
172 Assert.assertEquals(3, yun.getStartYear());
173 Assert.assertEquals(8, yun.getStartMonth());
174 Assert.assertEquals(0, yun.getStartDay());
175 Assert.assertEquals("2024-04-18", yun.getStartSolar().toYmd());
176
177 solar = new Solar(1972, 6, 15, 0, 0, 0);
178 lunar = solar.getLunar();
179 bazi = lunar.getEightChar();
180 yun = bazi.getYun(1);
181 Assert.assertEquals(7, yun.getStartYear());
182 Assert.assertEquals(5, yun.getStartMonth());
183 Assert.assertEquals(10, yun.getStartDay());
184 Assert.assertEquals("1979-11-25", yun.getStartSolar().toYmd());
185
186 solar = new Solar(1968, 11, 22, 0, 0, 0);
187 lunar = solar.getLunar();
188 bazi = lunar.getEightChar();
189 yun = bazi.getYun(1);
190 Assert.assertEquals(5, yun.getStartYear());
191 Assert.assertEquals(1, yun.getStartMonth());
192 Assert.assertEquals(20, yun.getStartDay());
193 Assert.assertEquals("1974-01-11", yun.getStartSolar().toYmd());
194
195 solar = new Solar(1968, 11, 23, 0, 0, 0);
196 lunar = solar.getLunar();
197 bazi = lunar.getEightChar();
198 yun = bazi.getYun(1);
199 Assert.assertEquals(4, yun.getStartYear());
200 Assert.assertEquals(9, yun.getStartMonth());
201 Assert.assertEquals(20, yun.getStartDay());
202 Assert.assertEquals("1973-09-12", yun.getStartSolar().toYmd());
203
204 solar = new Solar(1992, 2, 2, 12, 0, 0);
205 lunar = solar.getLunar();

Callers

nothing calls this directly

Calls 8

getLunarMethod · 0.95
getEightCharMethod · 0.95
getYunMethod · 0.95
getStartYearMethod · 0.95
getStartMonthMethod · 0.95
getStartDayMethod · 0.95
getStartSolarMethod · 0.95
toYmdMethod · 0.80

Tested by

no test coverage detected