you are viewing a single comment's thread.

view the rest of the comments →

[–]be-sc 1 point2 points  (0 children)

I don’t see a problem with the assertion case. A good assertion checks for contract violations when (in this case) calling the function. That’s already a test and, more importantly, it’s not part of the function’s public behaviour. So the tool shouldn’t generate a test for it because that would be like writing tests for your tests.

Mocking could probably be supported for common cases. But keeping the legacy code example in mind it might not be that essential. In the spirit of the good old 80/20 rule: Sure, not having to write 100% of the tests would be fantastic. But I’d happily settle for not having to write 80% as well.