v1.1.4
Latest
2022.3+
Class AsyncTestHelpers
Inheritance
System.Object
AsyncTestHelpers
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Unity.Services.Multiplayer.Tests.Helpers
Syntax
public static class AsyncTestHelpers
Methods
ExecuteTask(Func<Task>)
Declaration
public static IEnumerator ExecuteTask(Func<Task> taskFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task> | taskFunc |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
ExecuteTask(Task)
Declaration
public static IEnumerator ExecuteTask(Task task)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task | task |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
RunActionAsUnityCoroutine(Action<Action>)
Declaration
public static IEnumerator RunActionAsUnityCoroutine(Action<Action> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Action> | action |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
RunAsyncTest(Action<Action>, Action<Action>, Action, Action<Action>)
Declaration
public static IEnumerator RunAsyncTest(Action<Action> setup, Action<Action> test, Action validate, Action<Action> teardown)
Parameters
Type | Name | Description |
---|---|---|
System.Action<System.Action> | setup | |
System.Action<System.Action> | test | |
System.Action | validate | |
System.Action<System.Action> | teardown |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
ThrowsAsync<TException>(Func<Task>)
Declaration
public static async Task<TException> ThrowsAsync<TException>(Func<Task> func)
where TException : Exception
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Threading.Tasks.Task> | func |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TException> |
Type Parameters
Name | Description |
---|---|
TException |