View Javadoc
1   /******************************************************************************
2    * TestCookieString.java - Test the CookieString domain object 
3    * $Id$
4    * 
5    * BuckoFIBS - Backgammon by BuckoSoft
6    * Copyright© 2011 - Dick Balaska - BuckoSoft, Corp.
7    * 
8    * $Log$
9    * Revision 1.4  2011/06/13 06:06:05  dick
10   * Tests test better when they're actually run.
11   *
12   * Revision 1.3  2011/06/13 06:00:45  dick
13   * Try adding a setup() to get it run run in batch.
14   *
15   * Revision 1.2  2011/06/13 05:53:10  dick
16   * Test the setters, too.
17   *
18   * Revision 1.1  2011/06/13 05:46:09  dick
19   * Test the CookieString object.
20   *
21   */
22  
23  /* 
24   * This program is free software: you can redistribute it and/or modify
25   * it under the terms of the GNU General Public License as published by
26   * the Free Software Foundation, either version 3 of the License, or
27   * (at your option) any later version.
28   *
29   * This program is distributed in the hope that it will be useful,
30   * but WITHOUT ANY WARRANTY; without even the implied warranty of
31   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32   * GNU General Public License for more details.
33   *
34   * You should have received a copy of the GNU General Public License
35   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
36   *
37   * The Original Code is BuckoFIBS, <http://www.buckosoft.com/BuckoFIBS/>.
38   * The Initial Developer of the Original Code is Dick Balaska and BuckoSoft, Corp.
39   * 
40   */
41  package com.buckosoft.fibs.domain;
42  
43  import junit.framework.TestCase;
44  
45  import org.junit.Before;
46  import org.junit.Test;
47  
48  import com.buckosoft.fibs.domain.CookieString;
49  
50  /** Test the {@link com.buckosoft.fibs.domain.CookieString} domain object
51   * @author Dick Balaska
52   * @since 2011/06/13
53   * @version $Revision$ <br> $Date$
54   * @see <a href="http://cvs.buckosoft.com/Projects/BuckoFIBS/BuckoFIBS/src/test/java/com/buckosoft/fibs/test/domain/TestCookieString.java">cvs TestCookieString.java</a>
55   */
56  public class TestCookieString extends TestCase {
57  
58  	@Before
59  	public void setUp() throws Exception {
60  	}
61  
62  	/**
63  	 * Test method for all of {@link com.buckosoft.fibs.domain.CookieString}.
64  	 */
65  	@Test
66  	public void testCookieString() {
67  		CookieString cs = new CookieString();
68  		assertNull(cs.getString());
69  		assertEquals(0, cs.getCookie());
70  		cs = new CookieString(2, "HiMom");
71  		assertEquals(2, cs.getCookie());
72  		assertEquals("HiMom", cs.getString());
73  		cs.setCookie(3);
74  		assertEquals(3, cs.getCookie());
75  		cs.setString("HiDad");
76  		assertEquals("HiDad", cs.getString());
77  	}
78  
79  }