Is your feature request related to a problem? Please describe.
We have a DisposableCollection that takes care when the test fixture is disposed and should revert all the things it set up, but when a test fixture (like a temporary state) has several dependent test fixtures it sets up during its setup, and there is a failure during the setup - we are also left with a corrupt state.
Describe the solution you'd like
Introduce a SetupCollection that let's you 'revert' any added setup code previously added.
Describe alternatives you've considered
How I usually handled those scenarios, is by try/catching in the 'setup' code and dispose yourself in any kind of factory method where the test fixture is set up.
Additional context
Highly related to the already DisposableCollection, but this collection is not really disposable.
Is your feature request related to a problem? Please describe. We have a
DisposableCollection
that takes care when the test fixture is disposed and should revert all the things it set up, but when a test fixture (like a temporary state) has several dependent test fixtures it sets up during its setup, and there is a failure during the setup - we are also left with a corrupt state.Describe the solution you'd like Introduce a
SetupCollection
that let's you 'revert' any added setup code previously added.Describe alternatives you've considered How I usually handled those scenarios, is by
try
/catch
ing in the 'setup' code and dispose yourself in any kind of factory method where the test fixture is set up.Additional context Highly related to the already
DisposableCollection
, but this collection is not really disposable.