3 ms·
It depends on what language you are using and what things you are testing. If you use a language like Python, having tests that pass things that aren't the typ
by rhdunn 3y ago
It depends on what language you are using and what things you are testing.
If you use a language like Python, having tests that pass things that aren't the type you are expecting are useful. Likewise passing nulls to a nullable parameter, or different objects to an Object/Any type (or even a different implementation/type to a supertype parameter).
Those tests are part of the unit test repertoire, but unit tests should cover both expected cases/behaviour and unexpected cases.