Skip to content

Instantly share code, notes, and snippets.

@maniish-jaiin
Last active July 15, 2020 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maniish-jaiin/ebd61afb665a12896e2cc937d2e6b8d1 to your computer and use it in GitHub Desktop.
Save maniish-jaiin/ebd61afb665a12896e2cc937d2e6b8d1 to your computer and use it in GitHub Desktop.
@Test
public void addNumbersWhenMinusOperatorIsFound() {
ReversePolishNotation rpn = new ReversePolishNotation();
double result = rpn.evaluate("5 5 2 + -");
assertEquals(2.0, result, 0.1);
}
@Test
public void addNumbersWhenMultiplyOperatorIsFound() {
ReversePolishNotation rpn = new ReversePolishNotation();
double result = rpn.evaluate("5 5 2 + *");
assertEquals(35.0, result, 0.1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment