#28 J-N000

Открыто
J-N000 хочет смерджить 1 коммит(ов) из J-N000/ZCW-YeOldeCode:master в master
2 измененных файлов: 87 добавлений и 33 удалений
  1. 31
    0
      AccountTest.java
  2. 56
    33
      package.bluej

+ 31
- 0
AccountTest.java Просмотреть файл

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
+public class AccountTest
10
+{
11
+    @Test
12
+    public void accountCreationTest() {
13
+        Account actual = new Account(100);
14
+        assertNotNull(actual);
15
+    }
16
+    @Test
17
+    public void depositTest() {
18
+        Account test = new Account(50);
19
+        test.deposit(50);
20
+        int expected = 100;
21
+        int actual = test.balance();
22
+        assertEquals(expected, actual);     
23
+    }
24
+    @Test
25
+    public void nullaryConstructorTest() {
26
+        Account test = new Account();
27
+        int expected = 0;
28
+        int actual = test.balance();
29
+        assertEquals(expected, actual);
30
+    }
31
+}

+ 56
- 33
package.bluej Просмотреть файл

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