View Javadoc
1   /******************************************************************************
2    * TestSavedMatch.java - Test the FinishedMatch domain object 
3    * $Id$
4    * 
5    * BuckoFIBS - Backgammon by BuckoSoft
6    * Copyright© 2011 - Dick Balaska - BuckoSoft, Corp.
7    * 
8    * $Log$
9    * Revision 1.1  2011/05/07 05:51:51  dick
10   * Add TestSavedMatch.
11   *
12   */
13  
14  /* 
15   * This program is free software: you can redistribute it and/or modify
16   * it under the terms of the GNU General Public License as published by
17   * the Free Software Foundation, either version 3 of the License, or
18   * (at your option) any later version.
19   *
20   * This program is distributed in the hope that it will be useful,
21   * but WITHOUT ANY WARRANTY; without even the implied warranty of
22   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23   * GNU General Public License for more details.
24   *
25   * You should have received a copy of the GNU General Public License
26   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
27   *
28   * The Original Code is BuckoFIBS, <http://www.buckosoft.com/BuckoFIBS/>.
29   * The Initial Developer of the Original Code is Dick Balaska and BuckoSoft, Corp.
30   * 
31   */
32  package com.buckosoft.fibs.domain;
33  
34  import junit.framework.TestCase;
35  
36  import org.junit.Before;
37  import org.junit.Test;
38  
39  import com.buckosoft.fibs.domain.SavedMatch;
40  
41  public class TestSavedMatch extends TestCase {
42  	private SavedMatch sm = null;
43  	
44  	@Before
45  	public void setUp() throws Exception {
46  		sm = new SavedMatch();
47  	}
48  
49  	@Test
50  	public void testSavedMatch() {
51  		assertNotNull(new SavedMatch());
52  	}
53  
54  	@Test
55  	public void testGetOpponentName() {
56  		sm.setOpponentName("Bob");
57  		assertEquals("Bob", sm.getOpponentName());
58  	}
59  
60  	@Test
61  	public void testSetOpponentName() {
62  		sm.setOpponentName("Alice");
63  		assertEquals("Alice", sm.getOpponentName());
64  	}
65  
66  	@Test
67  	public void testGetMatchLength() {
68  		sm.setMatchLength(9);
69  		assertEquals(9, sm.getMatchLength());
70  	}
71  
72  	@Test
73  	public void testSetMatchLength() {
74  		sm.setMatchLength(11);
75  		assertEquals(11, sm.getMatchLength());
76  	}
77  
78  	@Test
79  	public void testGetYourScore() {
80  		sm.setYourScore(3);
81  		assertEquals(3, sm.getYourScore());
82  	}
83  
84  	@Test
85  	public void testSetYourScore() {
86  		sm.setYourScore(6);
87  		assertEquals(6, sm.getYourScore());
88  	}
89  
90  	@Test
91  	public void testGetOpponentScore() {
92  		sm.setOpponentScore(12);
93  		assertEquals(12, sm.getOpponentScore());
94  	}
95  
96  	@Test
97  	public void testSetOpponentScore() {
98  		sm.setOpponentScore(13);
99  		assertEquals(13, sm.getOpponentScore());
100 	}
101 
102 }