1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
45
46
47 public class TestFinishedMatch extends TestCase {
48 FinishedMatch fm = null;
49
50
51
52
53 @Before
54 public void setUp() throws Exception {
55 fm = new FinishedMatch();
56 }
57
58
59
60
61 @Test
62 public void testGetMatchId() {
63 fm.setMatchId(1);
64 assertEquals(1, fm.getMatchId());
65 }
66
67
68
69
70 @Test
71 public void testSetMatchId() {
72 fm.setMatchId(4);
73 assertEquals(4, fm.getMatchId());
74 }
75
76
77
78
79 @Test
80 public void testGetOpponentId() {
81 fm.setOpponentId(55);
82 assertEquals(55, fm.getOpponentId());
83 }
84
85
86
87
88 @Test
89 public void testSetOpponentId() {
90 fm.setOpponentId(77);
91 assertEquals(77, fm.getOpponentId());
92 }
93
94
95
96
97 @Test
98 public void testGetMatchPoints() {
99 fm.setMatchPoints(7);
100 assertEquals(7, fm.getMatchPoints());
101 }
102
103
104
105
106 @Test
107 public void testSetMatchPoints() {
108 fm.setMatchPoints(9);
109 assertEquals(9, fm.getMatchPoints());
110 }
111
112
113
114
115 @Test
116 public void testGetYourScore() {
117 fm.setYourScore(4);
118 assertEquals(4, fm.getYourScore());
119 }
120
121
122
123
124 @Test
125 public void testSetYourScore() {
126 fm.setYourScore(2);
127 assertEquals(2, fm.getYourScore());
128 }
129
130
131
132
133 @Test
134 public void testGetOpponentScore() {
135 fm.setOpponentScore(6);
136 assertEquals(6, fm.getOpponentScore());
137 }
138
139
140
141
142 @Test
143 public void testSetOpponentScore() {
144 fm.setOpponentScore(9);
145 assertEquals(9, fm.getOpponentScore());
146 }
147
148
149
150
151 @Test
152 public void testGetRatingAfterMatch() {
153 fm.setRatingAfterMatch(1599.1);
154 assertEquals(1599.1, fm.getRatingAfterMatch());
155 }
156
157
158
159
160 @Test
161 public void testSetRatingAfterMatch() {
162 fm.setRatingAfterMatch(1659.1);
163 assertEquals(1659.1, fm.getRatingAfterMatch());
164 }
165
166
167
168
169 @Test
170 public void testGetDuration() {
171 fm.setDuration(999);
172 assertEquals(999, fm.getDuration());
173 }
174
175
176
177
178 @Test
179 public void testSetDuration() {
180 fm.setDuration(1999);
181 assertEquals(1999, fm.getDuration());
182 }
183
184
185
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
196
197 @Test
198 public void testSetDate() {
199 Date d = new Date();
200 fm.setDate(d);
201 }
202
203 }