oss-slu / Pi4Micronaut

A java library combining Micronaut and Pi4j to streamline hardware connectivity to Raspberry Pi's
https://oss-slu.github.io/Pi4Micronaut/
Apache License 2.0
8 stars 7 forks source link

Issue #247: Added unit tests for LEDHelper functions #252

Closed leandrumartin closed 2 months ago

leandrumartin commented 2 months ago

Fixes #247. Added JUnit and Mockito dependencies in in the pi4micronaut-utils folder to allow unit tests in that folder. Added unit tests for LEDHelper class functions to ensure they work, mocking the DigitalOutput class since the testing does not involve physical Raspberry Pis. All the tests pass.

The issue description adds that the tests should check whether the LEDHelper generates appropriate log messages, but this is not yet taken care of.

CLAassistant commented 2 months ago

CLA assistant check
All committers have signed the CLA.

yrlmanoharreddy commented 2 months ago

The tests address key functionality but don't follow the modular structure we discussed, which is crucial for consistency and maintainability. From a product perspective, aligning the tests with the project's design ensures future scalability. The tests cover important scenarios, but they need to follow the same structure as the main code. Please revise accordingly to improve clarity and maintainability. Great effort—looking forward to the updated tests!

TASK: Changes that need to be done:

"Follow the structure same as the main code's structure."

Example in your case:

Additionally, please use "camelCase" conventions for member functions.

leandrumartin commented 2 months ago

I believe I've made all the necessary changes now.