When writing unit-tests, always follow the three-A’s: Arrange, Act, Assert. This divides every test into three distinct phases:
Arrange: set up the test-case, including any inputs, mocks, and expected outputs.
Act: perform the one action under test.
Assert: check the outcome of the action, including any return values and expected side effects.
Tip
Keep exactly one action in the Act phase. If you need two, that’s usually two tests.