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 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 }