Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
First beta, didn't realize how the honor system works so thanks for letting me know.
Regarding the unit tests, it would be nice if the different scenarios were each broken out into a separate test case. When your code fails, you just see that you failed one test, but its not clear why (did I forget to handle undefined? is it because of negative numbers? etc.)
If you put associated groups of "assertEquals" into their own @Test methods, the console output to the members will be more informative. For example, you might have:
Thanks again for the kata!
Ah apologies, I see now that it does test multiple cases. It is misleading because they are all in a single test case, perhaps could split them into separate test cases.
Agreed that the formatting is a very minor issue, just commenting. It is still important on a site focused on practicing code quality.
The initial code block is not formatted properly - brackets are misaligned.
The unit tests do not test for edge cases; at a minimum, should test for "undefined".