thomhurst / TUnit

A modern, fast and flexible .NET testing framework
MIT License
1.02k stars 8 forks source link

Allow DependsOn to proceed on test failure #567

Closed MelGrubb closed 11 hours ago

MelGrubb commented 11 hours ago

It would be helpful to be able to say that Test B requires Test A to complete, even if it fails. The example would be CRUD tests where even if the "Update" test failed, I still want to proceed with the "Delete" test in the suite.

1) Create a new object 2) Retrieve the newly-saved object. 3) (Depends on 2) Update the new object 4) (Depends on 3) Delete the new object

An optional boolean "MustPass" or, alternatively, "ProceedOnFailure" property on DependsOnAttribute would probably be enough. The default behavior should be that the named test must pass for this one to run, which is what it does now.

thomhurst commented 11 hours ago

@MelGrubb Available in 0.1.783

Docs here: https://thomhurst.github.io/TUnit/docs/tutorial-extras/depends-on#failures