arcus-azure / arcus.testing

Reusable testing components used during Arcus testing.
https://testing.arcus-azure.net/
MIT License
5 stars 2 forks source link

[Enhancement] provide async overload for `AsyncDisposable.Create` #146

Closed stijnmoreels closed 2 months ago

stijnmoreels commented 2 months ago

Is your feature request related to a problem? Please describe. Currently, the AsyncDisposable.Create expects sync input - this is expected since the AsyncDisposable is mainly used to act as a 'hook' to run sync code async during disposable of test fixtures, but when you only need a custom simple teardown, it might be more beneficial to have an async overload instead creating a dedicated IAsyncDisposable instance (except in languages like F# where implementing interfaces can be done dynamically/inline w/o a definition).

Describe the solution you'd like Create a async overload for the AsyncDisposable.Create for simple teardown operations w/o having the need for implementing dedicated instances.

Describe alternatives you've considered It can also be a way to explain that people should have dedicated instances, bc overusing the async overload could quickly result in unreadable and duplicated code, hence, why a dedicated instance is favorable.