aboutsummaryrefslogtreecommitdiffstats
path: root/trunk/ardor3d-ui/src/test
diff options
context:
space:
mode:
authorRenanse <[email protected]>2012-10-13 12:58:16 -0500
committerRenanse <[email protected]>2012-10-13 12:58:16 -0500
commite60afe7110d0d43cdc41f44aa631de19f312ec54 (patch)
tree99d94490c346b06186ebfbba79500a918b1f9ca1 /trunk/ardor3d-ui/src/test
parent555475f5aa57fb5feffefe30fa9a088341cd6a92 (diff)
moved to github
Diffstat (limited to 'trunk/ardor3d-ui/src/test')
-rw-r--r--trunk/ardor3d-ui/src/test/java/com/ardor3d/extension/ui/UIComponentTest.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/trunk/ardor3d-ui/src/test/java/com/ardor3d/extension/ui/UIComponentTest.java b/trunk/ardor3d-ui/src/test/java/com/ardor3d/extension/ui/UIComponentTest.java
new file mode 100644
index 0000000..ad9b63e
--- /dev/null
+++ b/trunk/ardor3d-ui/src/test/java/com/ardor3d/extension/ui/UIComponentTest.java
@@ -0,0 +1 @@
+ package com.ardor3d.extension.ui; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class UIComponentTest { private UIComponent component; @Before public void setUp() throws Exception { component = new UIComponent() { }; } @Test public void minimumSizeSetsContentSize() throws Exception { final int contentHeight = component.getContentHeight(); final int contentWidth = component.getContentWidth(); Assert.assertTrue(contentHeight < 200); Assert.assertTrue(contentWidth < 100); component.setMinimumContentSize(100, 200); Assert.assertEquals(100, component.getMinimumLocalComponentWidth()); Assert.assertEquals(200, component.getMinimumLocalComponentHeight()); Assert.assertEquals(100, component.getContentWidth()); Assert.assertEquals(200, component.getContentHeight()); } @Test public void cantSetContentSizeSmallerThanMinimum() throws Exception { final int minWidth = component.getMinimumLocalComponentWidth(); final int minHeight = component.getMinimumLocalComponentHeight(); final int contentHeight = component.getContentHeight(); final int contentWidth = component.getContentWidth(); Assert.assertTrue(contentWidth >= minWidth); Assert.assertTrue(contentHeight >= minHeight); component.setContentSize(minWidth - 2, minHeight - 1); Assert.assertEquals(minWidth, component.getContentWidth()); Assert.assertEquals(minHeight, component.getContentHeight()); } @Test public void cantSetContentSizeLargerThanMaximum() throws Exception { final int maxWidth = component.getMaximumLocalComponentWidth(); final int maxHeight = component.getMaximumLocalComponentHeight(); final int contentHeight = component.getContentHeight(); final int contentWidth = component.getContentWidth(); Assert.assertTrue(contentWidth <= maxWidth); Assert.assertTrue(contentHeight <= maxHeight); component.setContentSize(maxWidth + 2, maxHeight + 3); Assert.assertEquals(maxWidth, component.getContentWidth()); Assert.assertEquals(maxHeight, component.getContentHeight()); } } \ No newline at end of file