#Testing public API functions

1 messages · Page 1 of 1 (latest)

slate anvil
#

This is more of architectural/best practices question.

There's 2 main functions generate(...) -> Set(Action) and do(Action)

do calls generate to make sure the passed Action is valid.

So far almost all of my unit tests only concern generate (as that is 90% of my logic) and they don't test if do is processing those Actions correctly (as it is somewhat simple)

Do you think I should still add unit tests for do for those many Action cases too? Or can I just skimp out?

It'd be a lot of code. Basically every test for generate would have an accompanying test for an equivalent do if I were to test everything

sacred prism
#

Tests are a tool for increasing productivity, so if you don’t think that writing these tests would result in your saving time compared to manually testing it, then you’re better off doing the manual testing