Skip to content

Commit 40c5695

Browse files
committed
chore: updating docs
1 parent c864c68 commit 40c5695

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The main objective of this project is to keep it as a knowledge base about backe
88

99
</br>
1010

11-
The application is an authentication API where you call a third party authentication service (scr/infrasctructure/AuthenticationClient). A mock service was made for the authentication client. This app have an authentication route (/register), where a new account can be created and a route to retrieve all accounts (/getAllAccounts).
11+
The application is an authentication API where you call a third party authentication service (scr/infrastructure/AuthenticationClient). A mock service was made for the authentication client. This app have an authentication route (/register), where a new account can be created and a route to retrieve all accounts (/getAllAccounts).
1212

1313
The main goal of the application was to include the usecases that i wanted to test.
1414

@@ -72,7 +72,7 @@ content-type: application/json
7272

7373
# Tests
7474

75-
Some concepts and tips to have in mind when writting tests:
75+
Some concepts and tips to have in mind when writing tests:
7676

7777
- Validate only one scenario per test: minimize the number of asserts
7878
- Tests should be Stateless: all elements in a test should return to the initial state after each test.
@@ -96,6 +96,7 @@ Some concepts and tips to have in mind when writting tests:
9696
</br>
9797

9898
Have fun making tests :sunglasses:
99+
99100
## Unit Tests
100101

101102
Unit tests are focused on testing the logic path inside a code unit. This unit is usually a method. Tests should have none or just a few external dependencies. Most dependencies can be simulated through mocks.
@@ -109,6 +110,11 @@ Some tips:
109110
3. It's not necessary to create unit tests for all external dependencies. If you don't trust them, then you shouldn't be using them.
110111
4. The % percentage of coverage should not be the sole reference guiding a test strategy. Real code coverage will only be reached if item 1 from this list is followed.
111112

113+
Unit test example:
114+
115+
In this example, if you change the logic or comment any block of code, the related tests will fail.
116+
117+
![](docs/unit-test.jpg)
112118

113119

114120

docs/unit-test.jpg

232 KB
Loading

0 commit comments

Comments
 (0)