mhypolit / rpn-calculator

CLI RPN Calculator: A standard way to calculate a stack of number using 4 arithmetic operators and more.
0 stars 0 forks source link

Unit Testing for application #3

Closed mhypolit closed 2 years ago

mhypolit commented 2 years ago

Unit Testing for application

Possible use jester or Karma-Jasmine.

mhypolit commented 2 years ago

Use your best judgment as far as the format is concerned, as long as it makes sense to the end user. Your calculator should at the minimum handle the following examples.

Test 1:

enter 5 == 5 enter 8 == 8 enter + == 13

Test 2:

enter 5 5 5 8 + + - == -13.0 enter 13 + == 0.0

Test 3:

enter -3 == -3.0 enter -2 == -2.0 enter * == 6.0

Test 4:

enter 5 == 5.0 enter + == 11.0 enter 5 == 5 enter 9 == 9 enter 1 == 1 enter - == 8 enter / == 0.625