ItEr23S03ContornaItEr22S03: Adding test method
This commit is contained in:
parent
23e5dcb795
commit
bc33e678e8
1 changed files with 17 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package org.zkoss.ganttz.data.resourceload;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.hamcrest.CoreMatchers.sameInstance;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
|
|
@ -12,6 +13,9 @@ import org.junit.Test;
|
|||
|
||||
public class LoadTimelineTest {
|
||||
|
||||
private LoadTimeLine loadTimeLine;
|
||||
private String conceptName;
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void aLoadTimelineMustHaveANotNullName() {
|
||||
new LoadTimeLine(null, Collections.<LoadPeriod> emptyList());
|
||||
|
|
@ -27,6 +31,19 @@ public class LoadTimelineTest {
|
|||
new LoadTimeLine("bla", null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void theConceptNameCanBeRetrieved() {
|
||||
givenValidLoadTimeLine();
|
||||
assertThat(conceptName, equalTo(loadTimeLine.getConceptName()));
|
||||
}
|
||||
|
||||
private void givenValidLoadTimeLine() {
|
||||
conceptName = "bla";
|
||||
loadTimeLine = new LoadTimeLine(conceptName, Arrays
|
||||
.asList(new LoadPeriod(new LocalDate(2009, 10, 5),
|
||||
new LocalDate(2009, 10, 11), new LoadLevel(20))));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aLoadTimelineCanHaveZeroLoadPeriods() {
|
||||
new LoadTimeLine("bla", Collections.<LoadPeriod> emptyList());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue