backend-frontend-template icon indicating copy to clipboard operation
backend-frontend-template copied to clipboard

refactor: Use async initialization of tests

Open Rudomitori opened this issue 2 years ago • 2 comments

It solves a problem that tests run into deadlock if test collections are more than available threads

Rudomitori avatar Nov 01 '23 08:11 Rudomitori

There are the methods (RunSynchronously) that became unused after this PR. I don't delete it because I don't know whether they are used in other projects or not.

Rudomitori avatar Nov 01 '23 08:11 Rudomitori

Let me think a bit about this change.

Although, this seems nice, I'm worried that it might be confusing for developers, that they can't write the test-initialization code in constructors anymore (and have to override InitializeAsync method instead).

I mean, that changes like in webapi/tests/MccSoft.TemplateApp.ComponentTests/ProductControllerTests.cs are required in all tests, but developers are used to write initialization code in constructors (which seems like an obvious place, but it will not work anymore)

Shaddix avatar Nov 02 '23 05:11 Shaddix