< Summary

Class:SharpHoundCommonLib.AsyncEnumerable
Assembly:SharpHoundCommonLib
File(s):D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\AsyncEnumerable.cs
Covered lines:8
Uncovered lines:1
Coverable lines:9
Total lines:23
Line coverage:88.8% (8 of 9)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
Empty()100%10100%
.cctor()100%10100%
.ctor()100%10100%
GetAsyncEnumerator(...)100%10100%
DisposeAsync()100%10100%
MoveNextAsync()100%10100%

File(s)

D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\AsyncEnumerable.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Threading;
 3using System.Threading.Tasks;
 4
 5namespace SharpHoundCommonLib;
 6
 7public static class AsyncEnumerable {
 108    public static IAsyncEnumerable<T> Empty<T>() => EmptyAsyncEnumerable<T>.Instance;
 9
 10    private sealed class EmptyAsyncEnumerable<T> : IAsyncEnumerable<T> {
 311        public static readonly EmptyAsyncEnumerable<T> Instance = new();
 312        private readonly IAsyncEnumerator<T> _enumerator = new EmptyAsyncEnumerator<T>();
 1013        public IAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = new CancellationToken()) {
 1014            return _enumerator;
 1015        }
 16    }
 17
 18    private sealed class EmptyAsyncEnumerator<T> : IAsyncEnumerator<T> {
 1019        public ValueTask DisposeAsync() => default;
 1020        public ValueTask<bool> MoveNextAsync() => new(false);
 021        public T Current => default;
 22    }
 23}