#27 forgot to make pull request shiv-365

Ouvert
shiv-365 veut fusionner 1 révision(s) depuis shiv-365/ZCW-YeOldeCode:master vers master
3 fichiers modifiés avec 200 ajouts et 40 suppressions
  1. 75
    0
      ScrabbleTest.java
  2. 51
    0
      SquaresTest.java
  3. 74
    40
      package.bluej

+ 75
- 0
ScrabbleTest.java Voir le fichier

@@ -0,0 +1,75 @@
1
+
2
+
3
+import static org.junit.Assert.*;
4
+import org.junit.After;
5
+import org.junit.Before;
6
+import org.junit.Test;
7
+
8
+/**
9
+ * The test class ScrabbleTest.
10
+ *
11
+ * @author  (your name)
12
+ * @version (a version number or a date)
13
+ */
14
+public class ScrabbleTest
15
+{
16
+    
17
+    private Scrabble scrabble;
18
+    
19
+    /**
20
+     * Default constructor for test class ScrabbleTest
21
+     */
22
+    public ScrabbleTest()
23
+    {
24
+    }
25
+
26
+    /**
27
+     * Sets up the test fixture.
28
+     *
29
+     * Called before every test case method.
30
+     */
31
+    @Before
32
+    public void setUp()
33
+    {
34
+        Scrabble scrabble = new Scrabble();
35
+    }
36
+
37
+    /**
38
+     * Tears down the test fixture.
39
+     *
40
+     * Called after every test case method.
41
+     */
42
+    @After
43
+    public void tearDown()
44
+    {
45
+    }
46
+    
47
+    @Test
48
+    public void scoreDog(){
49
+        int expected = 5;
50
+        int actual = scrabble.score("dog");
51
+        
52
+        assertEquals(expected, actual);
53
+    
54
+    }
55
+     @Test
56
+    public void scoreFirework(){
57
+        int expected = 18;
58
+        int actual = scrabble.score("firework");
59
+        
60
+        assertEquals(expected, actual);
61
+    
62
+    }
63
+     @Test
64
+    public void scoreZumba(){
65
+        int expected = 18;
66
+        int actual = scrabble.score("zumba");
67
+        
68
+        assertEquals(expected, actual);
69
+    
70
+    }
71
+    
72
+}
73
+
74
+
75
+

+ 51
- 0
SquaresTest.java Voir le fichier

@@ -0,0 +1,51 @@
1
+
2
+
3
+import static org.junit.Assert.*;
4
+import org.junit.After;
5
+import org.junit.Before;
6
+import org.junit.Test;
7
+
8
+/**
9
+ * The test class SquaresTest.
10
+ *
11
+ * @author  (your name)
12
+ * @version (a version number or a date)
13
+ */
14
+public class SquaresTest
15
+{
16
+    
17
+    private Squares square;
18
+    /**
19
+     * Default constructor for test class SquaresTest
20
+     */
21
+    public SquaresTest()
22
+    {
23
+    }
24
+
25
+    /**
26
+     * Sets up the test fixture.
27
+     *
28
+     * Called before every test case method.
29
+     */
30
+    @Before
31
+    public void setUp()
32
+   
33
+    {
34
+        
35
+        Squares square = new Squares();
36
+        
37
+        
38
+    }
39
+
40
+    /**
41
+     * Tears down the test fixture.
42
+     *
43
+     * Called after every test case method.
44
+     */
45
+    @After
46
+    public void tearDown()
47
+    {
48
+        
49
+    }
50
+     
51
+}

+ 74
- 40
package.bluej Voir le fichier

@@ -1,26 +1,44 @@
1 1
 #BlueJ package file
2
-dependency1.from=Account
3
-dependency1.to=AccountException
2
+dependency1.from=Calendar1
3
+dependency1.to=CalendarGraphic
4 4
 dependency1.type=UsesDependency
5
-dependency2.from=DepositAccount
6
-dependency2.to=AccountException
5
+dependency2.from=Calendar1
6
+dependency2.to=DateException
7 7
 dependency2.type=UsesDependency
8
+dependency3.from=Account
9
+dependency3.to=AccountException
10
+dependency3.type=UsesDependency
11
+dependency4.from=Calendar
12
+dependency4.to=DateException
13
+dependency4.type=UsesDependency
14
+dependency5.from=Date
15
+dependency5.to=DateException
16
+dependency5.type=UsesDependency
17
+dependency6.from=DepositAccount
18
+dependency6.to=AccountException
19
+dependency6.type=UsesDependency
20
+dependency7.from=ScrabbleTest
21
+dependency7.to=Scrabble
22
+dependency7.type=UsesDependency
23
+dependency8.from=SquaresTest
24
+dependency8.to=Squares
25
+dependency8.type=UsesDependency
8 26
 editor.fx.0.height=722
9 27
 editor.fx.0.width=800
10 28
 editor.fx.0.x=114
11 29
 editor.fx.0.y=175
12 30
 objectbench.height=101
13
-objectbench.width=461
31
+objectbench.width=776
14 32
 package.divider.horizontal=0.6
15 33
 package.divider.vertical=0.8007380073800738
16 34
 package.editor.height=427
17 35
 package.editor.width=674
18
-package.editor.x=1006
36
+package.editor.x=880
19 37
 package.editor.y=133
20 38
 package.frame.height=600
21 39
 package.frame.width=800
22
-package.numDependencies=2
23
-package.numTargets=13
40
+package.numDependencies=8
41
+package.numTargets=15
24 42
 package.showExtends=true
25 43
 package.showUses=true
26 44
 project.charset=UTF-8
@@ -37,47 +55,63 @@ target1.width=130
37 55
 target1.x=450
38 56
 target1.y=190
39 57
 target10.height=50
40
-target10.name=Scrabble
58
+target10.name=ScrabbleTest
41 59
 target10.showInterface=false
42
-target10.type=ClassTarget
60
+target10.type=UnitTestTargetJunit4
43 61
 target10.width=80
44
-target10.x=10
45
-target10.y=250
62
+target10.x=40
63
+target10.y=220
64
+target11.association=ScrabbleTest
46 65
 target11.height=50
47
-target11.name=TriangleTwo
66
+target11.name=Scrabble
48 67
 target11.showInterface=false
49 68
 target11.type=ClassTarget
50
-target11.width=100
51
-target11.x=120
52
-target11.y=310
69
+target11.width=80
70
+target11.x=10
71
+target11.y=250
53 72
 target12.height=50
54
-target12.name=AccountException
73
+target12.name=DepositAccount
55 74
 target12.showInterface=false
56 75
 target12.type=ClassTarget
57
-target12.width=140
58
-target12.x=190
59
-target12.y=30
76
+target12.width=120
77
+target12.x=170
78
+target12.y=120
60 79
 target13.height=50
61
-target13.name=DateException
80
+target13.name=TriangleTwo
62 81
 target13.showInterface=false
63 82
 target13.type=ClassTarget
64
-target13.width=120
65
-target13.x=470
66
-target13.y=340
83
+target13.width=100
84
+target13.x=120
85
+target13.y=310
86
+target14.height=50
87
+target14.name=AccountException
88
+target14.showInterface=false
89
+target14.type=ClassTarget
90
+target14.width=140
91
+target14.x=190
92
+target14.y=30
93
+target15.height=50
94
+target15.name=DateException
95
+target15.showInterface=false
96
+target15.type=ClassTarget
97
+target15.width=120
98
+target15.x=470
99
+target15.y=340
67 100
 target2.height=50
68
-target2.name=Account
101
+target2.name=Calendar1
69 102
 target2.showInterface=false
70 103
 target2.type=ClassTarget
71
-target2.width=80
72
-target2.x=50
73
-target2.y=110
104
+target2.width=90
105
+target2.x=330
106
+target2.y=220
74 107
 target3.height=50
75
-target3.name=Calendar1
108
+target3.name=Account
76 109
 target3.showInterface=false
77 110
 target3.type=ClassTarget
78
-target3.width=90
79
-target3.x=330
80
-target3.y=220
111
+target3.width=80
112
+target3.x=50
113
+target3.y=110
114
+target4.association=SquaresTest
81 115
 target4.height=50
82 116
 target4.name=Squares
83 117
 target4.showInterface=false
@@ -107,16 +141,16 @@ target7.width=80
107 141
 target7.x=490
108 142
 target7.y=40
109 143
 target8.height=50
110
-target8.name=Date
144
+target8.name=SquaresTest
111 145
 target8.showInterface=false
112
-target8.type=ClassTarget
146
+target8.type=UnitTestTargetJunit4
113 147
 target8.width=80
114
-target8.x=350
115
-target8.y=290
148
+target8.x=130
149
+target8.y=220
116 150
 target9.height=50
117
-target9.name=DepositAccount
151
+target9.name=Date
118 152
 target9.showInterface=false
119 153
 target9.type=ClassTarget
120
-target9.width=120
121
-target9.x=170
122
-target9.y=120
154
+target9.width=80
155
+target9.x=350
156
+target9.y=290