NameFieldTest.java
00001 package edu.virtualschool.jwaa.test;
00002
00003 import edu.virtualschool.jwaa.field.NameField;
00004
00005 public class NameFieldTest extends junit.framework.TestCase
00006 {
00007 public NameFieldTest() { super("NameFieldTest"); }
00008 public NameFieldTest(String name) { super(name); }
00009 public void testInvalid()
00010 {
00011 NameField[] ary = new NameField[] {
00012 NameField.Null,
00013 new NameField(null),
00014 new NameField(""),
00015 new NameField("01234567890123456789012345678901234567890123456789012345678901234567890123456789"),
00016 new NameField("x")
00017 };
00018 for (int i = 0; i < ary.length; i++)
00019 {
00020 assertTrue(!ary[i].ok());
00021 }
00022 }
00023 public void testValid()
00024 {
00025 NameField[] ary = new NameField[] {
00026 new NameField("Foo Bar", "")
00027 };
00028 for (int i = 0; i < ary.length; i++)
00029 {
00030 assertTrue(ary[i].ok());
00031 }
00032 }
00033 }