소스 검색

TG updated 4

Tennessee Gibbs 8 년 전
부모
커밋
cb17215d93
7개의 변경된 파일339개의 추가작업 그리고 59개의 파일을 삭제
  1. 75
    0
      AccountTest.java
  2. 42
    0
      ScrabbleTest.java
  3. 66
    0
      SquaresTest.java
  4. 6
    0
      TextIO.java
  5. 42
    0
      TriangleTwoTest.java
  6. 0
    0
      Willy
  7. 108
    59
      package.bluej

+ 75
- 0
AccountTest.java 파일 보기

@@ -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 AccountTest.
10
+ *
11
+ * @author  (your name)
12
+ * @version (a version number or a date)
13
+ */
14
+public class AccountTest
15
+{
16
+    /**
17
+     * Default constructor for test class AccountTest
18
+     */
19
+    public AccountTest()
20
+    {
21
+    }
22
+
23
+    /**
24
+     * Sets up the test fixture.
25
+     *
26
+     * Called before every test case method.
27
+     */
28
+    @Before
29
+    public void setUp()
30
+    {
31
+    }
32
+
33
+    /**
34
+     * Tears down the test fixture.
35
+     *
36
+     * Called after every test case method.
37
+     */
38
+    @After
39
+    public void tearDown()
40
+    {
41
+    }
42
+
43
+    @Test
44
+    public void accountSum()
45
+    {
46
+        Account account1 = new Account(0);
47
+        assertEquals(null, account1.open(5));
48
+    }
49
+
50
+    @Test
51
+    public void deposit()
52
+    {
53
+        Account account1 = new Account();
54
+        account1.deposit(5);
55
+    }
56
+
57
+    @Test
58
+    public void balance()
59
+    {
60
+        Account account2 = new Account();
61
+        assertEquals(10, account2.balance());
62
+    }
63
+
64
+    @Test
65
+    public void transfer()
66
+    {
67
+        Account account1 = new Account();
68
+        account1.deposit(10);
69
+        assertEquals(true, account1.transfer(account1, 5));
70
+    }
71
+}
72
+
73
+
74
+
75
+

+ 42
- 0
ScrabbleTest.java 파일 보기

@@ -0,0 +1,42 @@
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
+     * Default constructor for test class ScrabbleTest
18
+     */
19
+    public ScrabbleTest()
20
+    {
21
+    }
22
+
23
+    /**
24
+     * Sets up the test fixture.
25
+     *
26
+     * Called before every test case method.
27
+     */
28
+    @Before
29
+    public void setUp()
30
+    {
31
+    }
32
+
33
+    /**
34
+     * Tears down the test fixture.
35
+     *
36
+     * Called after every test case method.
37
+     */
38
+    @After
39
+    public void tearDown()
40
+    {
41
+    }
42
+}

+ 66
- 0
SquaresTest.java 파일 보기

@@ -0,0 +1,66 @@
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
+     * Default constructor for test class SquaresTest
18
+     */
19
+    public SquaresTest()
20
+    {
21
+    }
22
+
23
+    /**
24
+     * Sets up the test fixture.
25
+     *
26
+     * Called before every test case method.
27
+     */
28
+    @Before
29
+    public void setUp()
30
+    {
31
+    }
32
+
33
+    /**
34
+     * Tears down the test fixture.
35
+     *
36
+     * Called after every test case method.
37
+     */
38
+    @After
39
+    public void tearDown()
40
+    {
41
+    }
42
+
43
+    @Test
44
+    public void Test1()
45
+    {
46
+        Squares squares2 = new Squares();
47
+        squares2.display(150);
48
+    }
49
+
50
+    @Test
51
+    public void Test2()
52
+    {
53
+        Squares squares1 = new Squares();
54
+        squares1.display(175);
55
+    }
56
+
57
+    @Test
58
+    public void Test3()
59
+    {
60
+        Squares squares1 = new Squares();
61
+        squares1.display(300);
62
+    }
63
+}
64
+
65
+
66
+

+ 6
- 0
TextIO.java 파일 보기

@@ -45,6 +45,12 @@ public class TextIO {
45 45
   }
46 46
 
47 47
   public static void prompt (String s) {
48
+  
49
+      // String z = new String ("fire");
50
+      // StringBuilder builder = new StringBuilder();
51
+      // builder.append(s);
52
+      // builder.append(z);
53
+      // String result = builder.toString();
48 54
     System.out.print(s + " ");
49 55
     System.out.flush();
50 56
   }

+ 42
- 0
TriangleTwoTest.java 파일 보기

@@ -0,0 +1,42 @@
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 TriangleTwoTest.
10
+ *
11
+ * @author  (your name)
12
+ * @version (a version number or a date)
13
+ */
14
+public class TriangleTwoTest
15
+{
16
+    /**
17
+     * Default constructor for test class TriangleTwoTest
18
+     */
19
+    public TriangleTwoTest()
20
+    {
21
+    }
22
+
23
+    /**
24
+     * Sets up the test fixture.
25
+     *
26
+     * Called before every test case method.
27
+     */
28
+    @Before
29
+    public void setUp()
30
+    {
31
+    }
32
+
33
+    /**
34
+     * Tears down the test fixture.
35
+     *
36
+     * Called after every test case method.
37
+     */
38
+    @After
39
+    public void tearDown()
40
+    {
41
+    }
42
+}

+ 0
- 0
Willy 파일 보기


+ 108
- 59
package.bluej 파일 보기

@@ -2,25 +2,43 @@
2 2
 dependency1.from=Account
3 3
 dependency1.to=AccountException
4 4
 dependency1.type=UsesDependency
5
-dependency2.from=DepositAccount
6
-dependency2.to=AccountException
5
+dependency2.from=Calendar
6
+dependency2.to=DateException
7 7
 dependency2.type=UsesDependency
8
-editor.fx.0.height=722
9
-editor.fx.0.width=800
10
-editor.fx.0.x=114
11
-editor.fx.0.y=175
8
+dependency3.from=Date
9
+dependency3.to=DateException
10
+dependency3.type=UsesDependency
11
+dependency4.from=Calendar1
12
+dependency4.to=CalendarGraphic
13
+dependency4.type=UsesDependency
14
+dependency5.from=Calendar1
15
+dependency5.to=DateException
16
+dependency5.type=UsesDependency
17
+dependency6.from=DepositAccount
18
+dependency6.to=AccountException
19
+dependency6.type=UsesDependency
20
+dependency7.from=AccountTest
21
+dependency7.to=Account
22
+dependency7.type=UsesDependency
23
+dependency8.from=SquaresTest
24
+dependency8.to=Squares
25
+dependency8.type=UsesDependency
26
+editor.fx.0.height=0
27
+editor.fx.0.width=0
28
+editor.fx.0.x=0
29
+editor.fx.0.y=0
12 30
 objectbench.height=101
13
-objectbench.width=461
14
-package.divider.horizontal=0.6
15
-package.divider.vertical=0.8007380073800738
16
-package.editor.height=427
17
-package.editor.width=674
18
-package.editor.x=1006
19
-package.editor.y=133
20
-package.frame.height=600
21
-package.frame.width=800
22
-package.numDependencies=2
23
-package.numTargets=13
31
+objectbench.width=649
32
+package.divider.horizontal=0.6001829826166514
33
+package.divider.vertical=0.8343558282208589
34
+package.editor.height=537
35
+package.editor.width=987
36
+package.editor.x=152
37
+package.editor.y=82
38
+package.frame.height=710
39
+package.frame.width=1113
40
+package.numDependencies=8
41
+package.numTargets=17
24 42
 package.showExtends=true
25 43
 package.showUses=true
26 44
 project.charset=UTF-8
@@ -37,40 +55,69 @@ 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=Date
41 59
 target10.showInterface=false
42 60
 target10.type=ClassTarget
43 61
 target10.width=80
44
-target10.x=10
45
-target10.y=250
62
+target10.x=350
63
+target10.y=290
46 64
 target11.height=50
47
-target11.name=TriangleTwo
65
+target11.name=ScrabbleTest
48 66
 target11.showInterface=false
49
-target11.type=ClassTarget
50
-target11.width=100
51
-target11.x=120
52
-target11.y=310
67
+target11.type=UnitTestTargetJunit4
68
+target11.width=80
69
+target11.x=40
70
+target11.y=220
71
+target12.association=ScrabbleTest
53 72
 target12.height=50
54
-target12.name=AccountException
73
+target12.name=Scrabble
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=80
77
+target12.x=10
78
+target12.y=250
60 79
 target13.height=50
61
-target13.name=DateException
80
+target13.name=DepositAccount
62 81
 target13.showInterface=false
63 82
 target13.type=ClassTarget
64 83
 target13.width=120
65
-target13.x=470
66
-target13.y=340
84
+target13.x=170
85
+target13.y=120
86
+target14.height=50
87
+target14.name=TriangleTwo
88
+target14.showInterface=false
89
+target14.type=ClassTarget
90
+target14.width=100
91
+target14.x=120
92
+target14.y=310
93
+target15.height=50
94
+target15.name=AccountException
95
+target15.showInterface=false
96
+target15.type=ClassTarget
97
+target15.width=140
98
+target15.x=190
99
+target15.y=30
100
+target16.height=50
101
+target16.name=AccountTest
102
+target16.showInterface=false
103
+target16.type=UnitTestTargetJunit4
104
+target16.width=80
105
+target16.x=70
106
+target16.y=80
107
+target17.height=50
108
+target17.name=DateException
109
+target17.showInterface=false
110
+target17.type=ClassTarget
111
+target17.width=120
112
+target17.x=470
113
+target17.y=340
67 114
 target2.height=50
68
-target2.name=Account
115
+target2.name=TriangleTwoTest
69 116
 target2.showInterface=false
70
-target2.type=ClassTarget
71
-target2.width=80
72
-target2.x=50
73
-target2.y=110
117
+target2.type=UnitTestTargetJunit4
118
+target2.width=130
119
+target2.x=130
120
+target2.y=180
74 121
 target3.height=50
75 122
 target3.name=Calendar1
76 123
 target3.showInterface=false
@@ -78,45 +125,47 @@ target3.type=ClassTarget
78 125
 target3.width=90
79 126
 target3.x=330
80 127
 target3.y=220
128
+target4.association=AccountTest
81 129
 target4.height=50
82
-target4.name=Squares
130
+target4.name=Account
83 131
 target4.showInterface=false
84 132
 target4.type=ClassTarget
85 133
 target4.width=80
86
-target4.x=100
87
-target4.y=250
134
+target4.x=40
135
+target4.y=110
136
+target5.association=SquaresTest
88 137
 target5.height=50
89
-target5.name=Calendar
138
+target5.name=Squares
90 139
 target5.showInterface=false
91 140
 target5.type=ClassTarget
92 141
 target5.width=80
93
-target5.x=490
94
-target5.y=270
142
+target5.x=230
143
+target5.y=390
95 144
 target6.height=50
96
-target6.name=TriangleOne
145
+target6.name=Calendar
97 146
 target6.showInterface=false
98 147
 target6.type=ClassTarget
99
-target6.width=100
100
-target6.x=10
101
-target6.y=310
148
+target6.width=80
149
+target6.x=490
150
+target6.y=270
102 151
 target7.height=50
103
-target7.name=TextIO
152
+target7.name=TriangleOne
104 153
 target7.showInterface=false
105 154
 target7.type=ClassTarget
106
-target7.width=80
107
-target7.x=490
108
-target7.y=40
155
+target7.width=100
156
+target7.x=10
157
+target7.y=310
109 158
 target8.height=50
110
-target8.name=Date
159
+target8.name=SquaresTest
111 160
 target8.showInterface=false
112
-target8.type=ClassTarget
161
+target8.type=UnitTestTargetJunit4
113 162
 target8.width=80
114
-target8.x=350
115
-target8.y=290
163
+target8.x=260
164
+target8.y=360
116 165
 target9.height=50
117
-target9.name=DepositAccount
166
+target9.name=TextIO
118 167
 target9.showInterface=false
119 168
 target9.type=ClassTarget
120
-target9.width=120
121
-target9.x=170
122
-target9.y=120
169
+target9.width=80
170
+target9.x=490
171
+target9.y=40