-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintegration-testing-notes.txt
23 lines (16 loc) · 1.61 KB
/
integration-testing-notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
https://stackoverflow.com/questions/20711300/controlling-execution-order-of-unit-tests-in-visual-studio
order by test name:
use partial classes with ITC_AAE_ prefix, AAE, AAJ, AAO, AAT, AAY up to ZZY for 3000+ test classes
increase in steps of 5
use Test_AAA_0000_ prefix, 0000 to 9990 increase in steps of 10 for 1000 test cases per class
let declarations be sorted
have mechanism to skip tests, such as creating a dedicated skip exception type and running all tests cases through a wrapper method that checks for skipping in earlier tests
make use of sleeping and polling (https://github.com/awaitility/awaitility), as last resort for async testing
make use of libraries for comparing nested structures for equality, like https://github.com/fluentassertions/fluentassertions or the tree data matcher module in this repository
leverage simple facade for making http requests, like js fetch, python requests
store temporary state with service locator pattern and per assembly/process or per class hooks/scopes.
use constructor/dispose pattern to create global and local variable context
*Will need to start service under test in a known database state. Ensure it is running
and started successfully before running tests. And also stop the service after test is run.
And not have left over processes disturbing any restarts (e.g. port already in use).
-This need is simplified if service start and stop can be done outside of integration testing. Conveniently eliminates all these issues with left over effects and having to know what command line arguments and environment variables to use, etc. Example is to use OS containers or CI builds.