File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
yoonexample/src/test/java/stack Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ package stack ;
2
+
3
+ import org .junit .jupiter .api .BeforeEach ;
4
+ import org .junit .jupiter .api .DisplayName ;
5
+ import org .junit .jupiter .api .Test ;
6
+
7
+ class InfixCalculatorTest {
8
+
9
+ InfixCalculator infixCalculator ;
10
+
11
+ @ BeforeEach
12
+ void setUp () {
13
+ infixCalculator = new InfixCalculator ();
14
+ }
15
+
16
+ @ Test
17
+ @ DisplayName ("중위_표기법으로_작성된_수식_계산_테스트1" )
18
+ void 중위_표기법으로_작성된_수식_계산_테스트1 () {
19
+ String input = "1 + 2 * 3" ;
20
+
21
+ assertThat (infixCalculator .calculate (input )).isEqualTo (7 );
22
+ }
23
+
24
+ @ Test
25
+ @ DisplayName ("중위_표기법으로_작성된_수식_계산_테스트2" )
26
+ void 중위_표기법으로_작성된_수식_계산_테스트2 () {
27
+ String input = "(1 + 2) * 3" ;
28
+
29
+ assertThat (infixCalculator .calculate (input )).isEqualTo (9 );
30
+ }
31
+
32
+ @ Test
33
+ @ DisplayName ("중위_표기법으로_작성된_수식_계산_테스트3" )
34
+ void 중위_표기법으로_작성된_수식_계산_테스트3 () {
35
+ String input = "((1 - 2) + 3) * (5 - 2)" ;
36
+
37
+ assertThat (infixCalculator .calculate (input )).isEqualTo (6 );
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments