Class AsyncUtility
- Namespace
- Xunit.Sdk
- Assembly
- xunit.v3.common.dll
Utility class for dealing with asynchronous operations.
public static class AsyncUtility
- Inheritance
-
AsyncUtility
- Inherited Members
Methods
- IsAsync(MethodInfo)
Determines if the given method is async, as matters to xUnit.net. This means it either (a) returns a Task or ValueTask; or, (b) it is an F# function which was declared as async. Note that this is not the same thing as an "awaitable" method, since xUnit.net does not recreate the compiler's await machinery at runtime.
- IsAsyncVoid(MethodInfo)
Determines if the given method is async void by looking for the AsyncStateMachineAttribute and void return type on the method definition.
- TryConvertToValueTask(object?)
Given an object, will attempt to convert instances of Task or Microsoft.FSharp.Control.FSharpAsync`1 into ValueTask as appropriate. Will return
nullif the object is not a task of any supported type. Note that this list of supported tasks is purposefully identical to the list used by IsAsync(MethodInfo).