PageRenderTime 20ms CodeModel.GetById 14ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

/sigmah/src/test/java/org/sigmah/shared/command/MonthTest.java

http://sigma-h.googlecode.com/
Java | 32 lines | 20 code | 12 blank | 0 comment | 0 complexity | 70864db994732af23ee8e5dd01961e60 MD5 | raw file
 1package org.sigmah.shared.command;
 2
 3import static org.junit.Assert.*;
 4import static org.hamcrest.CoreMatchers.*;
 5
 6import org.junit.Test;
 7
 8public class MonthTest {
 9
10	
11	@Test
12	public void rollover() {
13		
14		Month june2010 = new Month(2010, 6);
15	
16		Month elevenMonthsLater = june2010.plus(11);
17		
18		assertThat(elevenMonthsLater.getYear(), equalTo(2011));
19		assertThat(elevenMonthsLater.getMonth(), equalTo(5));
20	}
21	
22	@Test
23	public void rollback() {
24		
25		Month jan2010 = new Month(2010,1);
26		Month earlier = jan2010.previous();
27		
28		assertThat(earlier.getYear(), equalTo(2009));
29		assertThat(earlier.getMonth(), equalTo(12));
30	}
31	
32}