Project: engagement_generation License: BSD Dependencies:
Used by:
None |
engagement_generation/test/edu/wpi/hri/gen/GenerationParamsTest.javaGo to the documentation of this file.00001 package edu.wpi.hri.gen; 00002 00003 import junit.framework.TestCase; 00004 00005 import org.junit.Test; 00006 00007 public class GenerationParamsTest extends TestCase { 00008 00009 @Test 00010 public void testBoolean() { 00011 assertFalse("Default of boolean params should be false", 00012 GenerationParams._TEST_BOOL_.getBoolean()); 00013 00014 GenerationParams._TEST_BOOL_.setBoolean(true); 00015 assertTrue(GenerationParams._TEST_BOOL_.getBoolean()); 00016 assertFalse(GenerationParams._TEST_DOUBLE_.getBoolean()); 00017 } 00018 00019 @Test 00020 public void testDouble() { 00021 assertTrue("Default of double params should be 0.0", 00022 GenerationParams._TEST_DOUBLE_.getDouble() == 0.0); 00023 00024 GenerationParams._TEST_DOUBLE_.setDouble(3.14); 00025 assertTrue(GenerationParams._TEST_DOUBLE_.getDouble() == 3.14); 00026 assertTrue(GenerationParams._TEST_BOOL_.getDouble() == 0.0); 00027 } 00028 00029 @Test 00030 public void testInt() { 00031 assertTrue("Default of int params should be 0", 00032 GenerationParams._TEST_INT_.getInt() == 0); 00033 00034 GenerationParams._TEST_INT_.setInt(314); 00035 assertTrue(GenerationParams._TEST_INT_.getInt() == 314); 00036 assertTrue(GenerationParams._TEST_BOOL_.getInt() == 0); 00037 } 00038 00039 @Test 00040 public void testString() { 00041 assertTrue("Default of String params should be \"\"", 00042 GenerationParams._TEST_STRING_.getString().isEmpty()); 00043 00044 GenerationParams._TEST_STRING_.setString("Hello World!"); 00045 assertTrue(GenerationParams._TEST_STRING_.getString().equals( 00046 "Hello World!")); 00047 assertTrue(GenerationParams._TEST_BOOL_.getString().isEmpty()); 00048 } 00049 } |