When I write unit tests for complex logic, I like to create helper functions to make the tests more readable. Makes testing much more productive and rewarding. One of my favourites are my ASCII tests for the grid layout logic of http://longplay.app.
When I write unit tests for complex logic, I like to create helper functions to make the tests more readable. Makes testing much more productive and rewarding. One of my favourites are my ASCII tests for the grid layout logic of http://longplay.app.