View Javadoc
1   /******************************************************************************
2    * TestFinishedMatch.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 06:20:54  dick
10   * Test the rest of the domain package.
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 java.util.Date;
35  
36  import junit.framework.TestCase;
37  
38  import org.junit.Before;
39  import org.junit.Test;
40  
41  import com.buckosoft.fibs.domain.FinishedMatch;
42  
43  /**
44   * @author dick
45   *
46   */
47  public class TestFinishedMatch extends TestCase {
48  	FinishedMatch fm = null;
49  
50  	/**
51  	 * @throws java.lang.Exception
52  	 */
53  	@Before
54  	public void setUp() throws Exception {
55  		fm = new FinishedMatch();
56  	}
57  
58  	/**
59  	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#getMatchId()}.
60  	 */
61  	@Test
62  	public void testGetMatchId() {
63  		fm.setMatchId(1);
64  		assertEquals(1, fm.getMatchId());
65  	}
66  
67  	/**
68  	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#setMatchId(int)}.
69  	 */
70  	@Test
71  	public void testSetMatchId() {
72  		fm.setMatchId(4);
73  		assertEquals(4, fm.getMatchId());
74  	}
75  
76  	/**
77  	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#getOpponentId()}.
78  	 */
79  	@Test
80  	public void testGetOpponentId() {
81  		fm.setOpponentId(55);
82  		assertEquals(55, fm.getOpponentId());
83  	}
84  
85  	/**
86  	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#setOpponentId(int)}.
87  	 */
88  	@Test
89  	public void testSetOpponentId() {
90  		fm.setOpponentId(77);
91  		assertEquals(77, fm.getOpponentId());
92  	}
93  
94  	/**
95  	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#getMatchPoints()}.
96  	 */
97  	@Test
98  	public void testGetMatchPoints() {
99  		fm.setMatchPoints(7);
100 		assertEquals(7, fm.getMatchPoints());
101 	}
102 
103 	/**
104 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#setMatchPoints(int)}.
105 	 */
106 	@Test
107 	public void testSetMatchPoints() {
108 		fm.setMatchPoints(9);
109 		assertEquals(9, fm.getMatchPoints());
110 	}
111 
112 	/**
113 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#getYourScore()}.
114 	 */
115 	@Test
116 	public void testGetYourScore() {
117 		fm.setYourScore(4);
118 		assertEquals(4, fm.getYourScore());
119 	}
120 
121 	/**
122 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#setYourScore(int)}.
123 	 */
124 	@Test
125 	public void testSetYourScore() {
126 		fm.setYourScore(2);
127 		assertEquals(2, fm.getYourScore());
128 	}
129 
130 	/**
131 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#getOpponentScore()}.
132 	 */
133 	@Test
134 	public void testGetOpponentScore() {
135 		fm.setOpponentScore(6);
136 		assertEquals(6, fm.getOpponentScore());
137 	}
138 
139 	/**
140 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#setOpponentScore(int)}.
141 	 */
142 	@Test
143 	public void testSetOpponentScore() {
144 		fm.setOpponentScore(9);
145 		assertEquals(9, fm.getOpponentScore());
146 	}
147 
148 	/**
149 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#getRatingAfterMatch()}.
150 	 */
151 	@Test
152 	public void testGetRatingAfterMatch() {
153 		fm.setRatingAfterMatch(1599.1);
154 		assertEquals(1599.1, fm.getRatingAfterMatch());
155 	}
156 
157 	/**
158 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#setRatingAfterMatch(double)}.
159 	 */
160 	@Test
161 	public void testSetRatingAfterMatch() {
162 		fm.setRatingAfterMatch(1659.1);
163 		assertEquals(1659.1, fm.getRatingAfterMatch());
164 	}
165 
166 	/**
167 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#getDuration()}.
168 	 */
169 	@Test
170 	public void testGetDuration() {
171 		fm.setDuration(999);
172 		assertEquals(999, fm.getDuration());
173 	}
174 
175 	/**
176 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#setDuration(int)}.
177 	 */
178 	@Test
179 	public void testSetDuration() {
180 		fm.setDuration(1999);
181 		assertEquals(1999, fm.getDuration());
182 	}
183 
184 	/**
185 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#getDate()}.
186 	 */
187 	@Test
188 	public void testGetDate() {
189 		Date d = new Date();
190 		fm.setDate(d);
191 		assertEquals(d.getTime(), fm.getDate().getTime());
192 	}
193 
194 	/**
195 	 * Test method for {@link com.buckosoft.fibs.domain.FinishedMatch#setDate(java.util.Date)}.
196 	 */
197 	@Test
198 	public void testSetDate() {
199 		Date d = new Date();
200 		fm.setDate(d);
201 	}
202 
203 }