< Summary

Class:GDX.Threading.TaskExtensions
Assembly:GDX
File(s):./Packages/com.dotbunny.gdx/GDX/Threading/TaskExtensions.cs
Covered lines:6
Uncovered lines:0
Coverable lines:6
Total lines:29
Line coverage:100% (6 of 6)
Covered branches:0
Total branches:0
Covered methods:1
Total methods:1
Method coverage:100% (1 of 1)

Coverage History

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
AsIEnumerator()0%440100%

File(s)

./Packages/com.dotbunny.gdx/GDX/Threading/TaskExtensions.cs

#LineLine coverage
 1// Copyright (c) 2020-2024 dotBunny Inc.
 2// dotBunny licenses this file to you under the BSL-1.0 license.
 3// See the LICENSE file in the project root for more information.
 4
 5using System.Collections;
 6using System.Threading.Tasks;
 7
 8namespace GDX.Threading
 9{
 10    /// <summary>
 11    ///     <see cref="Task" /> Based Extension Methods
 12    /// </summary>
 13    public static class TaskExtensions
 14    {
 15        /// <summary>
 16        ///     Wraps a <see cref="Task" /> for use in a coroutine.
 17        /// </summary>
 18        /// <remarks>Don't use coroutines.</remarks>
 19        /// <param name="task">An established <see cref="Task" />.</param>
 20        /// <returns>An <see cref="IEnumerator" /> for use with coroutines.</returns>
 21        public static IEnumerator AsIEnumerator(this Task task)
 2022        {
 22423            while (!task.IsCompleted)
 20424            {
 20425                yield return null;
 20426            }
 2027        }
 28    }
 29}

Coverage by test methods













Methods/Properties

AsIEnumerator()