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

Method testFromMonday

src/test/java/test/WeekTest.java:16–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14public class WeekTest {
15
16 @Test
17 public void testFromMonday(){
18 //一周的开始从星期一开始计
19 int start = 1;
20 SolarWeek week = new SolarWeek(2019,5,1,start);
21 Assert.assertEquals("2019.5.1",week.toString());
22 Assert.assertEquals("2019年5月第1周",week.toFullString());
23 //当月共几周
24 Assert.assertEquals(5,SolarUtil.getWeeksOfMonth(week.getYear(),week.getMonth(),start));
25 //当周第一天
26 Assert.assertEquals("2019-04-29",week.getFirstDay().toString());
27 //当周第一天(本月)
28 Assert.assertEquals("2019-05-01",week.getFirstDayInMonth().toString());
29 }
30
31 @Test
32 public void testFromSunday(){

Callers

nothing calls this directly

Calls 8

toStringMethod · 0.95
toFullStringMethod · 0.95
getWeeksOfMonthMethod · 0.95
getYearMethod · 0.95
getMonthMethod · 0.95
getFirstDayMethod · 0.95
getFirstDayInMonthMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected