1
- package calculator ;
1
+ package ru . evrnsky . calculator ;
2
2
3
- import org .junit .Test ;
4
- import start .StubIO ;
3
+
4
+ import org .junit .jupiter .api .Test ;
5
+ import ru .evrnsky .start .StubIO ;
6
+
7
+ import static org .hamcrest .MatcherAssert .assertThat ;
5
8
import static org .hamcrest .core .StringContains .containsString ;
6
- import static org .junit .Assert .assertThat ;
7
9
8
10
/**
9
11
* Unit test for CalcInit.java.
10
12
* It test all opportunity from UI of Calculator.
11
13
*/
12
- public class CalcInitTest {
14
+ class CalcInitTest {
13
15
14
16
/**
15
17
* When try execute addiction from calculator UI.
16
18
* should check that calculator return correct result.
19
+ *
17
20
* @throws Exception if something wrong.
18
21
*/
19
22
@ Test
20
- public void whenTryAddTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult ()
23
+ void whenTryAddTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult ()
21
24
throws Exception {
22
25
String [] answer = new String []{"0" , "1.0" , "y" };
23
26
StubIO stubIO = new StubIO (answer );
@@ -32,10 +35,11 @@ public void whenTryAddTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult()
32
35
/**
33
36
* When try execute deduct use calculator UI.
34
37
* should check that calculator return correct result.
38
+ *
35
39
* @throws Exception if something wrong.
36
40
*/
37
41
@ Test
38
- public void whenTryDeductTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult ()
42
+ void whenTryDeductTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult ()
39
43
throws Exception {
40
44
String [] answer = new String []{"0" , "100.0" , "n" , "1" , "1" , "y" };
41
45
StubIO stubIO = new StubIO (answer );
@@ -49,10 +53,11 @@ public void whenTryDeductTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult()
49
53
50
54
/**
51
55
* When try execute multiply should check that calculator return correct result.
56
+ *
52
57
* @throws Exception if something wrong.
53
58
*/
54
59
@ Test
55
- public void whenTryMultiplyTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult ()
60
+ void whenTryMultiplyTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult ()
56
61
throws Exception {
57
62
String [] answer = new String []{"0" , "2.0" , "n" , "2" , "10" , "y" };
58
63
StubIO stubIO = new StubIO (answer );
@@ -66,10 +71,11 @@ public void whenTryMultiplyTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult(
66
71
67
72
/**
68
73
* When try execute divide use calculator UI should check than calculator return correct result.
74
+ *
69
75
* @throws Exception if something wrong.
70
76
*/
71
77
@ Test
72
- public void whenTryDivideTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult ()
78
+ void whenTryDivideTwoDoubleUseCalculatorUIShouldCheckThatCorrectResult ()
73
79
throws Exception {
74
80
String [] answer = new String []{"0" , "100.0" , "n" , "3" , "2" , "y" };
75
81
StubIO stubIO = new StubIO (answer );
0 commit comments