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: docs/UtUtilsClass.md
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,21 @@
3
3
## What are the utility methods
4
4
5
5
_Utility methods_ implement common, often re-used operations which are helpful for accomplishing tasks in many
6
-
classes. In UnitTestBot _utility methods_ include those related to creating instances, checking deep
7
-
equals, working with arrays, using lambdas and so on — miscellaneous methods necessary for generated tests.
6
+
classes. In UnitTestBot,_utility methods_ include those related to creating instances, checking deep
7
+
equality, mocking, using lambdas and so on — miscellaneous methods necessary for generated tests.
8
8
9
9
## Why to create UtUtils class
10
10
11
-
Previously UnitTestBot generated _utility methods_ for each test class when they were needed — and only those which were necessary for the given class. They were declared right in the generated test class, occupying space. Generating multiple test classes often resulted in duplicating _utility methods_ and consuming even more space.
11
+
Previously, UnitTestBot generated _utility methods_ for each test class when they were needed — and only those which
12
+
were necessary for the given class. They were declared right in the generated test class, occupying space. Generating multiple test classes often resulted in duplicating _utility methods_ and consuming even more space.
12
13
13
14
For now UnitTestBot provides a special `UtUtils` class containing all _utility methods_ if at least one test class needs some of them. This class is generated once and the specific methods are imported from it if necessary. No need for _utility methods_ — no `UtUtils` class is generated.
14
15
15
-
We create a separate `UtUtils` class for each supported codegen language (if this class is required).
16
+
We create a separate `UtUtils` class for each supported language (if required).
16
17
17
18
## What does it look like
18
19
19
-
Here is an example of documentation comment inherent to every `UtUtils` class:
20
+
Here is an example of a documentation comment inherent to every `UtUtils` class:
20
21
21
22

22
23
@@ -35,8 +36,9 @@ UnitTestBot uses [Mockito framework](https://site.mockito.org/) to implement moc
35
36
`deepEquals()`
36
37
_utility method_ should be configured — it should have a check: whether the compared object is a mock or not. That is why the `UtUtils` class for the tests with mocking differs from the one without mocking support.
37
38
38
-
If you have previously generated tests with mocking, the next `UtUtils` class will support mocking as well — even if
39
-
it is upgraded or current tests do not need mocking, so that the existing tests can still
39
+
If you have previously generated tests with mocking, the next generated `UtUtils` class supports mocking as well —
40
+
even if
41
+
its version is upgraded or current tests do not need mocking, so that the existing tests can still
0 commit comments