Skip to content

Commit

Permalink
Removed original app example. Added a few more tests to shunting yard…
Browse files Browse the repository at this point in the history
… algorithm.
  • Loading branch information
schuchert committed Nov 26, 2013
1 parent 0efd041 commit 1ab6247
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 43 deletions.
7 changes: 0 additions & 7 deletions src/main/java/shoe/example/firstproject/App.java

This file was deleted.

@@ -1,7 +1,11 @@
package shoe.example.firstproject;


public class ShuntingYardAlgorithm {
public String translate(String infixExpression) {
return infixExpression != null ? infixExpression : "";
String result = infixExpression != null ? infixExpression : "";
if(!result.matches("\\d*"))
throw new IllegalArgumentException("Badly formed expression");
return result;
}
}
35 changes: 0 additions & 35 deletions src/test/java/shoe/example/firstproject/AppTest.java

This file was deleted.

Expand Up @@ -31,4 +31,9 @@ public void shouldReturnNumberUnchanged() {
String result = shuntingYardAlgorithm.translate("45");
assertThat(result, is("45"));
}

@Test(expected=RuntimeException.class)
public void shouldRejectOperatorOnly() {
shuntingYardAlgorithm.translate("+");
}
}

0 comments on commit 1ab6247

Please sign in to comment.