You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The main objective of this project is to keep it as a knowledge base about backe
8
8
9
9
</br>
10
10
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).
12
12
13
13
The main goal of the application was to include the usecases that i wanted to test.
14
14
@@ -72,7 +72,7 @@ content-type: application/json
72
72
73
73
# Tests
74
74
75
-
Some concepts and tips to have in mind when writting tests:
75
+
Some concepts and tips to have in mind when writing tests:
76
76
77
77
- Validate only one scenario per test: minimize the number of asserts
78
78
- 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:
96
96
</br>
97
97
98
98
Have fun making tests :sunglasses:
99
+
99
100
## Unit Tests
100
101
101
102
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:
109
110
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.
110
111
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.
111
112
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.
0 commit comments