Calculator As a user of Calculator I want to perform mathematical calculation such as division So that I can perform more complex calculations
test/resources/calculator/Calculator.feature
Scenario: Divide 2 numbers
Given a calculator
When I divide 4 by 2
Then I should get 2
Scenario: Divide two numbers
Examples:
Given a calculator
When I divide <n1> by <n2>
Then I should get <result>
n1 | n2 | result |
---|---|---|
30 | 5 | 6 |
0 | 100 | 0 |
12 | 0 | Cannot divide by 0 |
10.2 | 1 | 10 |
10 | 1.0 | 10 |
Example: {n1=30, n2=5, result=6}
Given a calculator
When I divide 30 by 5
Then I should get 6
Example: {n1=0, n2=100, result=0}
Given a calculator
When I divide 0 by 100
Then I should get 0
Example: {n1=12, n2=0, result=Cannot divide by 0}
Given a calculator
When I divide 12 by 0
Then I should get Cannot divide by 0 (FAILED)
Example: {n1=10.2, n2=1, result=10}
Given a calculator
When I divide 10.2 by 1
Then I should get 10
Example: {n1=10, n2=1.0, result=10}
Given a calculator
When I divide 10 by 1.0
Then I should get 10