... |
... |
@@ -4,14 +4,12 @@ |
4 |
4 |
|
5 |
5 |
### Benefits of Mocking |
6 |
6 |
|
7 |
|
-* Isolation of units to test each unit separately, dramatically reducing complexity and increasing test execution speed by replacing loaded modules with mocks. |
8 |
|
-* Simplifies the re-creation of specific scenarios (use cases, boundary cases). |
9 |
|
-* Expose hidden internals of production code without compromising encapsulation. |
10 |
|
-* Injection of test-specific behaviors not present in production code. |
11 |
|
-* Enables the simulation of indirect dependencies by letting mocks return other mocks. |
|
7 |
+* **Isolation of units** to test each unit separately, dramatically reducing complexity and increasing test execution speed by replacing loaded modules with mocks. |
|
8 |
+* **Simplifies the re-creation of specific scenarios** (use cases, boundary cases) in which a dependency behaves in a particular way. |
|
9 |
+* **Expose hidden internals** of production code without compromising encapsulation. |
|
10 |
+* **Injection of test-specific behaviors** not present in production code. |
|
11 |
+* **Enables the simulation of indirect dependencies** by letting mocks return other mocks. |
12 |
12 |
|
13 |
|
-### |
14 |
|
- |
15 |
15 |
### Types of Mocks |
16 |
16 |
|
17 |
17 |
Stubs are by far the most common type of mock. Keep your tests as simple as possible. Make them more complex only when necessary. |
... |
... |
@@ -21,7 +21,7 @@ |
21 |
21 |
* **Spy**: Records internal data of the unit being tested when such data is not directly accessible. |
22 |
22 |
* **Mock object**: Contains complex logic, simulates behaviors such as computation and exception handling, and can even run tests. |
23 |
23 |
|
24 |
|
-### |
|
22 |
+### |
25 |
25 |
|
26 |
26 |
### Tips |
27 |
27 |
|