A test is not an Unit Test when:
- it tests more than one thing at once (i.e. it tests how two things work together) - then it is an integration test
Checklist for good unit tests:
- they are automated
- they are repeatable
- they are easy to implement
- they remain for future use, once written
- they can be run by anyone
- they can be run by the push of a button
- they run quickly
Some more best practices (in no particular order of importance):
- tests should be separated from integration tests (which are slower), so that they can be run fast as frequently as possible
- they should not comprise too much logic (preferably, no control structures)
- every test should test only one thing (thus, they should contain only one assert)
- the expected values used in assertions should be hard-coded and not computed at test run-time
- external dependencies (filesystem, time, memory etc.) should be replaced by stubs
- test should recreate the initial state at test shutdown
- in assertions, it is better to use a "contains..." policy, rather than "is strictly equal..." policy (i.e. we expect certain values in a collection, certain characters in a string etc.)
This is part of the knowledge I have extracted from Roy Osherove's book - The Art of Unit Testing