Skip to content

Commit

Permalink
commit-3
Browse files Browse the repository at this point in the history
  • Loading branch information
kmchau428 committed Jan 21, 2016
1 parent 5779f49 commit 2344ea0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/develogical/app/QueryProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ else if (query.toLowerCase().contains("your name")) {
}
else if (query.toLowerCase().contains("plus")) {
String[] array = query.split(" ");
int intOne = Integer.valueOf(array[2]);
int intTwo = Integer.valueOf(array[4]);
int intOne = Integer.valueOf(array[3]);
int intTwo = Integer.valueOf(array[5]);

return String.valueOf(intOne + intTwo);
}
Expand Down
6 changes: 4 additions & 2 deletions src/test/java/com/develogical/app/QueryProcessorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ public class QueryProcessorTest {

@Test
public void tets() throws InterruptedException {
String[] array = "ff3cd6e0: which of the following numbers is the largest: 288, 26".split(" ");


assertEquals("288", queryProcessor.process("ff3cd6e0: which of the following numbers is the largest: 288, 26") );
assertEquals("7", queryProcessor.process("ed52a100: what is 6 plus 1") );
}


}

0 comments on commit 2344ea0

Please sign in to comment.