Too bad to write a very long (over 200 lines) test method? Or should I break it down into smaller methods?
You should not (generally) create any 200-line method. If you can break it, do it.
What do you do in 200 lines? Unit testing should test small units of code. Are these 200 lines primarily statements? If yes, then it may be OK.
The key question is: can anyone understand what the method does, quickly or hard to lower its head?
" , , , ". ( , )
200 . unit test . " " , . .
- , , , Eager Test.
, , Arrange/Act/Assert. 200 , , , , .
, , , , . , , .
, 200 . , , , : , , , , .
, : -)
. , .
unit-tests, . , -, .
- , unit test, , .
, 200 , , , .
, , . ( ), .
Source: https://habr.com/ru/post/1720777/More articles:Detecting the same class twice with WCF - classProcessing Office xml documents (xlsx) with PHP - xmlHow to install django dippcript fragment? - linuxRed5: развертывание во время работы Red5 (отказ развертывания WAR: org.springframework.beans.factory. BeanDefinitionStoreException) при нормальном развертывании ok) - deploymentFast scrolling of cells of the table with images. Is this done? - iphoneActionScript 3: How to get the symbol name, not the instance name - flashDifference between PHP and .htaccess redirection - phphow to show the default location of the user and the individual view of the annotation in the map set? - objective-cAutomatic primary key increment without setting an identifier - sqlC # interop marshalling and disposing - c #All Articles