1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.util;
17
18 import java.sql.Date;
19 import java.util.Map;
20
21 import org.joda.time.DateTime;
22 import org.junit.Assert;
23 import org.junit.Test;
24 import org.kuali.hr.test.KPMETestCase;
25 import org.kuali.hr.time.detail.web.ActionFormUtils;
26 import org.kuali.hr.time.test.TkTestUtils;
27 import org.kuali.hr.time.timesheet.TimesheetDocument;
28
29 public class ActionFormUtilsTest extends KPMETestCase {
30
31 @Test
32 public void testBuildAssignmentStyleClassMap() {
33 Date aDate = new Date((new DateTime(2011, 7, 7, 0, 0, 0, 0, TKUtils.getSystemDateTimeZone())).getMillis());
34 TimesheetDocument doc = TkTestUtils.populateTimesheetDocument(aDate);
35 Map<String, String> aMap = ActionFormUtils.buildAssignmentStyleClassMap(doc.getTimeBlocks());
36 Assert.assertEquals("Wrong number of classes in style class map", 1, aMap.size());
37 Assert.assertEquals("Wrong key for class assignment0", "assignment0", aMap.get("1_1234_1"));
38 }
39
40 }