01: /*
02: Copyright 2004-2007 Paul R. Holser, Jr. All rights reserved.
03: Licensed under the Academic Free License version 3.0
04: */
05:
06: package joptsimple.util;
07:
08: import java.util.Arrays;
09:
10: /**
11: * @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
12: * @version $Id: OneColumnDefaultJustificationTestCase.java,v 1.3 2007/04/10 20:06:26 pholser Exp $
13: */
14: public class OneColumnDefaultJustificationTestCase extends
15: ColumnarDataTestCase {
16: protected String[] headers() {
17: return new String[] { "header" };
18: }
19:
20: public void testNoRows() {
21: assertEquals(Arrays
22: .asList(new Object[] { "header ", "------ " }), lines());
23: }
24:
25: public void testDataShorterThanHeader() {
26: grid.addRow(new Object[] { "data" });
27:
28: assertEquals(Arrays.asList(new Object[] { "header ", "------ ",
29: "data " }), lines());
30: }
31:
32: public void testDataAsLongAsHeader() {
33: grid.addRow(new Object[] { "values" });
34:
35: assertEquals(Arrays.asList(new Object[] { "header ", "------ ",
36: "values " }), lines());
37: }
38:
39: public void testDataLongerThanHeader() {
40: grid.addRow(new Object[] { "calculation" });
41:
42: assertEquals(Arrays.asList(new Object[] { "header ",
43: "----------- ", "calculation " }), lines());
44: }
45: }
|