Pi4J / pi4j-v1

DEPRECATED Java I/O library for Raspberry Pi (GPIO, I2C, SPI, UART)
http://www.pi4j.com
Apache License 2.0
1.31k stars 447 forks source link

Removed exception handling (test smell) #497

Closed eas5 closed 4 years ago

eas5 commented 4 years ago

Problem: The exception handling test smell occurs when a test method explicitly a passing or failing of a test method is dependent on the production method throwing an exception.

Correction: I used JUnit's exception handling to automatically pass/fail the test instead of writing custom exception handling code or throwing an exception. The original method generated two new ones: with and without the correct parameter, which must raise an exception.

FDelporte commented 4 years ago

Thanks @eas5 for your first contribution! Having clear and consistent tests is indeed critical in a software project, so any support and improvement is very welcome!