https://github.com/chamons/async-void-no-more
Tool to track down async void tests that should be async Task in C#
https://github.com/chamons/async-void-no-more
Last synced: 10 months ago
JSON representation
Tool to track down async void tests that should be async Task in C#
- Host: GitHub
- URL: https://github.com/chamons/async-void-no-more
- Owner: chamons
- License: mit
- Created: 2021-04-14T14:59:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-14T15:08:50.000Z (over 4 years ago)
- Last Synced: 2025-01-20T14:55:31.981Z (12 months ago)
- Language: C#
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# async-void-no-more
async-void-no-more is a simple tool to track down async void tests that should be async Task in C#.
## Example
This test:
```csharp
public void MyTest() => TestStatus(async (a, b) => await new lib.Search(a, b));
```
should return a Task, or else exceptions thrown will be lost and sadness will ensure.
## Isn't there a roslyn analyzer for this?
You'd thing, wouldn't you?!?
- There apparently [used to be ASYNC0003](https://roslyn-analyzers.readthedocs.io/en/latest/analyzers-info/async/avoid-async-void-methods.html) but I couldn't find it in the latest release, and it was unconditional.
- [vs-threading](https://github.com/microsoft/vs-threading/blob/main/doc/analyzers/index.md) has VSTHRD100 but I was unable to get working in a reasonable time in my project.