Test Overview
This test checks if the input field correctly accepts values at the boundary limits and rejects values outside those limits. It verifies that the system handles edge cases properly.
This test checks if the input field correctly accepts values at the boundary limits and rejects values outside those limits. It verifies that the system handles edge cases properly.
def is_valid_input(value): return 1 <= value <= 10 def test_input_boundary_values(): min_value = 1 max_value = 10 # Test lower boundary assert is_valid_input(min_value) == True # Test just below lower boundary assert is_valid_input(min_value - 1) == False # Test upper boundary assert is_valid_input(max_value) == True # Test just above upper boundary assert is_valid_input(max_value + 1) == False
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Test environment initialized | - | PASS |
| 2 | Call is_valid_input with value 1 (lower boundary) | Function receives input 1 | Assert that return value is True | PASS |
| 3 | Call is_valid_input with value 0 (just below lower boundary) | Function receives input 0 | Assert that return value is False | PASS |
| 4 | Call is_valid_input with value 10 (upper boundary) | Function receives input 10 | Assert that return value is True | PASS |
| 5 | Call is_valid_input with value 11 (just above upper boundary) | Function receives input 11 | Assert that return value is False | PASS |
| 6 | Test ends | All assertions passed | - | PASS |