Permalink
Browse files

more tests

  • Loading branch information...
1 parent 43f568d commit 9f9ba924c800c0c50916da039748ff54d63bd673 si committed May 20, 2012
Showing with 28 additions and 0 deletions.
  1. +28 −0 siniautils/src/test/java/com/siniatech/siniautils/swing/TestBoundsHelper.java
@@ -85,6 +85,34 @@ public void getXExtentOfComponents_multiple() {
}
@Test
+ public void getYExtentOfComponents_failsWithNull() {
+ try {
+ getYExtentOfComponents( null );
+ fail();
+ } catch ( Exception e ) {
+ }
+ }
+
+ @Test
+ public void getYExtentOfComponents_emptyList() {
+ assertEquals( 0, getYExtentOfComponents( Arrays.<JComponent> asList() ) );
+ }
+
+ @Test
+ public void getYExtentOfComponents_single() {
+ assertEquals( 400, getYExtentOfComponents( Arrays.<JComponent> asList( a ) ) );
+ assertEquals( 700, getYExtentOfComponents( Arrays.<JComponent> asList( b ) ) );
+ assertEquals( 700, getYExtentOfComponents( Arrays.<JComponent> asList( c ) ) );
+ }
+
+ @Test
+ public void getYExtentOfComponents_multiple() {
+ assertEquals( 700, getYExtentOfComponents( Arrays.<JComponent> asList( a, b ) ) );
+ assertEquals( 700, getYExtentOfComponents( Arrays.<JComponent> asList( b, c ) ) );
+ assertEquals( 700, getYExtentOfComponents( Arrays.<JComponent> asList( a, b, c ) ) );
+ }
+
+ @Test
public void compShouldContainPointAtBounds() {
JPanel panel = new JPanel();
panel.setBounds( 20, 30, 40, 50 );

0 comments on commit 9f9ba92

Please sign in to comment.