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

Method testLunarTimeGan

src/test/java/test/TimeTest.java:238–255  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

236 }
237 }
238 @Test
239 public void testLunarTimeGan(){
240 for(Map.Entry<String,String> entry:GAN.entrySet()){
241 int hour = 0,minute = 0;
242 String time = entry.getKey();
243 int year = Integer.parseInt(time.substring(0,4));
244 int month = Integer.parseInt(time.substring(4,time.indexOf(",")));
245 int day = Integer.parseInt(time.substring(time.indexOf(",")+1,time.lastIndexOf(",")));
246 String hm = time.substring(time.lastIndexOf(",")+1);
247 if(hm.length()>=5){
248 hour = Integer.parseInt(hm.substring(0,2),10);
249 minute = Integer.parseInt(hm.substring(3,5),10);
250 }
251 Lunar lunar = Lunar.fromYmdHms(year,month,day,hour,minute,0);
252 String gan = entry.getValue();
253 Assert.assertEquals(lunar.getYear()+"年"+lunar.getMonthInChinese()+"月"+lunar.getDayInChinese()+" "+hm, gan, lunar.getTimeGan());
254 }
255 }
256
257
258 @Test

Callers

nothing calls this directly

Calls 5

fromYmdHmsMethod · 0.95
getYearMethod · 0.95
getMonthInChineseMethod · 0.95
getDayInChineseMethod · 0.95
getTimeGanMethod · 0.95

Tested by

no test coverage detected