Shivam Patel 6 anos atrás
pai
commit
725f6e54ee
3 arquivos alterados com 103 adições e 30 exclusões
  1. 51
    0
      TicketMachineTest.java
  2. 26
    15
      bluej.pkg
  3. 26
    15
      package.bluej

+ 51
- 0
TicketMachineTest.java Ver arquivo

@@ -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 TicketMachineTest.
10
+ *
11
+ * @author  (your name)
12
+ * @version (a version number or a date)
13
+ */
14
+public class TicketMachineTest
15
+{
16
+    /**
17
+     * Default constructor for test class TicketMachineTest
18
+     */
19
+    public TicketMachineTest()
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 testTicket()
45
+    {
46
+        TicketMachine ticketMa1 = new TicketMachine(50505);
47
+        ticketMa1.insertMoney(699605);
48
+        assertEquals(0, ticketMa1.toString());
49
+    }
50
+}
51
+

+ 26
- 15
bluej.pkg Ver arquivo

@@ -1,20 +1,23 @@
1 1
 #BlueJ package file
2
-editor.fx.0.height=722
3
-editor.fx.0.width=800
4
-editor.fx.0.x=709
5
-editor.fx.0.y=113
6
-objectbench.height=101
7
-objectbench.width=461
2
+dependency1.from=TicketMachineTest
3
+dependency1.to=TicketMachine
4
+dependency1.type=UsesDependency
5
+editor.fx.0.height=0
6
+editor.fx.0.width=0
7
+editor.fx.0.x=0
8
+editor.fx.0.y=0
9
+objectbench.height=164
10
+objectbench.width=776
8 11
 package.divider.horizontal=0.6
9
-package.divider.vertical=0.8007380073800738
10
-package.editor.height=427
12
+package.divider.vertical=0.6845018450184502
13
+package.editor.height=364
11 14
 package.editor.width=674
12
-package.editor.x=1067
15
+package.editor.x=880
13 16
 package.editor.y=119
14 17
 package.frame.height=600
15 18
 package.frame.width=800
16
-package.numDependencies=0
17
-package.numTargets=1
19
+package.numDependencies=1
20
+package.numTargets=2
18 21
 package.showExtends=true
19 22
 package.showUses=true
20 23
 project.charset=UTF-8
@@ -24,9 +27,17 @@ readme.width=47
24 27
 readme.x=10
25 28
 readme.y=10
26 29
 target1.height=50
27
-target1.name=TicketMachine
30
+target1.name=TicketMachineTest
28 31
 target1.showInterface=false
29
-target1.type=ClassTarget
32
+target1.type=UnitTestTargetJunit4
30 33
 target1.width=120
31
-target1.x=80
32
-target1.y=50
34
+target1.x=110
35
+target1.y=20
36
+target2.association=TicketMachineTest
37
+target2.height=50
38
+target2.name=TicketMachine
39
+target2.showInterface=false
40
+target2.type=ClassTarget
41
+target2.width=120
42
+target2.x=80
43
+target2.y=50

+ 26
- 15
package.bluej Ver arquivo

@@ -1,20 +1,23 @@
1 1
 #BlueJ package file
2
-editor.fx.0.height=722
3
-editor.fx.0.width=800
4
-editor.fx.0.x=709
5
-editor.fx.0.y=113
6
-objectbench.height=101
7
-objectbench.width=461
2
+dependency1.from=TicketMachineTest
3
+dependency1.to=TicketMachine
4
+dependency1.type=UsesDependency
5
+editor.fx.0.height=0
6
+editor.fx.0.width=0
7
+editor.fx.0.x=0
8
+editor.fx.0.y=0
9
+objectbench.height=164
10
+objectbench.width=776
8 11
 package.divider.horizontal=0.6
9
-package.divider.vertical=0.8007380073800738
10
-package.editor.height=427
12
+package.divider.vertical=0.6845018450184502
13
+package.editor.height=364
11 14
 package.editor.width=674
12
-package.editor.x=1067
15
+package.editor.x=880
13 16
 package.editor.y=119
14 17
 package.frame.height=600
15 18
 package.frame.width=800
16
-package.numDependencies=0
17
-package.numTargets=1
19
+package.numDependencies=1
20
+package.numTargets=2
18 21
 package.showExtends=true
19 22
 package.showUses=true
20 23
 project.charset=UTF-8
@@ -24,9 +27,17 @@ readme.width=47
24 27
 readme.x=10
25 28
 readme.y=10
26 29
 target1.height=50
27
-target1.name=TicketMachine
30
+target1.name=TicketMachineTest
28 31
 target1.showInterface=false
29
-target1.type=ClassTarget
32
+target1.type=UnitTestTargetJunit4
30 33
 target1.width=120
31
-target1.x=80
32
-target1.y=50
34
+target1.x=110
35
+target1.y=20
36
+target2.association=TicketMachineTest
37
+target2.height=50
38
+target2.name=TicketMachine
39
+target2.showInterface=false
40
+target2.type=ClassTarget
41
+target2.width=120
42
+target2.x=80
43
+target2.y=50