Pedro12909 / RexCord

A Discord Bot written in Java
MIT License
7 stars 4 forks source link

#56 Added unit tests for commands #58

Closed GaruGaru closed 6 years ago

GaruGaru commented 6 years ago

Still missing tests for some commands for the following reasons:

GaruGaru commented 6 years ago

Looks like the tests are passing but the build fails because checkstyle doesn't allow the RexCord class to be extendable ,but in order to test it you have to mock / extend it or just create an interface between the commands and the real object or just skip the "DesignForExtension" check in checkstyle.xml configuration

tumit commented 6 years ago

@GaruGaru I want to help to write unit testing for this project and I use PowerMockito to mock final class and static class it work properly :)

PS. now I sent PR for some unit testing in package: command.music

details: https://www.codeproject.com/Articles/806508/Using-PowerMockito-to-Mock-Final-and-Static-Method

GaruGaru commented 6 years ago

Hey @tumit looks nice ! That library definitely solves the final classes problem. Thank you very much for the effort and for the docs :+1: i'll update the pull request using the library you proposted asap.

edit: integrated successfully thank you @tumit !

Pedro12909 commented 6 years ago

Hi @GaruGaru Thanks for your contribution. Your work looks good. However, just for the record, make sure that you create a PR to our dev branch instead of master. This ensures master is always stable and working. Since this is not really a feature but some UTs, im going to open an exception and accept it :)