Skip to content

Commit b825ce9

Browse files
committed
Add test for PlusOperator in OperatorExecutorTest
1 parent 970bc65 commit b825ce9

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

feature/stoplist/src/main/java/com/chaeny/busoda/stoplist/operator/OperatorExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.util.List;
55

66
public class OperatorExecutor {
7-
public int main(String[] args) {
7+
public int executeOperation(String[] args) {
88
if (args.length < 3) {
99
throw new IllegalArgumentException("모두 입력해주세요.");
1010
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.chaeny.busoda.stoplist.operator;
2+
3+
import static org.junit.Assert.*;
4+
import org.junit.Test;
5+
6+
public class OperatorExecutorTest {
7+
8+
OperatorExecutor operatorExecutor = new OperatorExecutor();
9+
10+
@Test
11+
public void testPlusOperator() {
12+
String[] args = {"2", "+", "2"};
13+
int result = operatorExecutor.executeOperation(args);
14+
assertEquals(result, 4);
15+
}
16+
}

0 commit comments

Comments
 (0)