To learn how to name our tests, let's refactor the unit tests Stringie developers wrote. This time, they fixed some of the mistakes from Lesson 2, but they forgot to follow a naming convention. You will find the solution with the tests they wrote, next to this file.
Test names shoud tell the scenario under test and the expected results. Don't worry about long names when writing unit tests since test names show the purpose behind what they're testing. You don't need assertion messages if you name your test the right way.
Your mission, Jim, should you decide to accept it, is to rename the unit test Stringie developers wrote. You will find the instructions to proceed below. This repo will self-destruct in five seconds. Good luck, Jim.
- Clone this repo
- Follow a naming convention. Pick one of these:
- "ItShould" follow by an action
- "UnitOfWork_Scenario_ExpectedResult"
- Plain English sentence without "should" and "should be", using underscores as separator
- Sentence from classes and methods names
- Nested classes and methods
- When you finish renaming or refactoring the tests, use another naming convention to practice
For examples of these naming conventions, check How to name your unit tests.
You can take a look at the README file from Lesson 1 to check all the Stringie avialable methods.