Stockeye项目 - CalendarStock包(初步设计)

预构

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// class UtilCalTime
public int getIntCal();
public String getStrCal();
public String getCalFormat();
public String getTimeHHMMSS();
public String getTimeFormat();
public String getLatestDayOfStock();
public String[] getWorkdayArrayUtilNow();
public int getIntWeekday();
public String getWeekday();
public int getCountByTenSecond();
public boolean checkIsWorkday();
public String convertIntToCalFormat();
public int convertStrCalToInt();
public int getQuarterByMonth();
public int getWeekIndexOfYear();
public int getDateIndexOfYear();

TDD

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.msolo.stockeye.calendarstock;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.Ignore;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/**
* Tests for UtilCalTime
*
* @author yuezhi.msolo@outlook.com (kevin mSolo)
*/
public class UtilCalTimeTest {
private UtilCalTime utilCalTime = UtilCalTime.getInstance();
@Test
public void testAssertClassSingleton() {
UtilCalTime utilCalTimeAnother = UtilCalTime.getInstance();
assertSame("should be same", utilCalTime, utilCalTimeAnother);
}
@Test
public void testGetIntCal() {
int intCal = utilCalTime.getIntCal(new GregorianCalendar());
int intCalTest = 20141108;
testAssertEquals("should be equal", intCal, intCalTest);
}
}

Coding

CI

Document