The ultimate aim of unit testing is to test a specific piece of code/component in isolation to make sure that components work according to specification. This reduces the chances of failures/bugs in the component when integrated with other parts of the software. Before we start writing tests, there are some guidelines that can help us write good and maintainable tests:
One unit should test one behavior. For obvious reasons, testing one behavior per unit test makes sense. A failing unit test should clearly highlight the problem area. If multiple behaviors are tested together, a failed test requires more probing to assert what behavior was violated.
Dependencies in a unit test should be mocked away. Unit testing, as the name suggests, should test the unit and not its dependencies.
Unit tests should not change the state of the component being tested permanently. If it does, the other tests may get affected.
The order of execution of unit tests should be immaterial...