()
| 218 | }; |
| 219 | |
| 220 | @Test |
| 221 | public void testLunarTimeGanZhi(){ |
| 222 | for(Map.Entry<String,String> entry:GAN_ZHI.entrySet()){ |
| 223 | int hour = 0,minute = 0; |
| 224 | String time = entry.getKey(); |
| 225 | int year = Integer.parseInt(time.substring(0,4)); |
| 226 | int month = Integer.parseInt(time.substring(4,time.indexOf(","))); |
| 227 | int day = Integer.parseInt(time.substring(time.indexOf(",")+1,time.lastIndexOf(","))); |
| 228 | String hm = time.substring(time.lastIndexOf(",")+1); |
| 229 | if(hm.length()>=5){ |
| 230 | hour = Integer.parseInt(hm.substring(0,2),10); |
| 231 | minute = Integer.parseInt(hm.substring(3,5),10); |
| 232 | } |
| 233 | Lunar lunar = Lunar.fromYmdHms(year,month,day,hour,minute,0); |
| 234 | String ganZhi = entry.getValue(); |
| 235 | Assert.assertEquals(lunar.getYear()+"年"+lunar.getMonthInChinese()+"月"+lunar.getDayInChinese()+" "+hm, ganZhi, lunar.getTimeInGanZhi()); |
| 236 | } |
| 237 | } |
| 238 | @Test |
| 239 | public void testLunarTimeGan(){ |
| 240 | for(Map.Entry<String,String> entry:GAN.entrySet()){ |
nothing calls this directly
no test coverage detected