Last active
July 15, 2020 11:48
-
-
Save maniish-jaiin/ebd61afb665a12896e2cc937d2e6b8d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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