• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NetFabric / NetFabric.CodeAnalysis / 6130084901

09 Sep 2023 09:14AM UTC coverage: 83.158% (+0.2%) from 82.932%
6130084901

push

github

web-flow
Fixes (#27)

227 of 266 branches covered (0.0%)

Branch coverage included in aggregate %.

661 of 661 new or added lines in 31 files covered. (100.0%)

642 of 779 relevant lines covered (82.41%)

18.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/NetFabric.Reflection/Reflection/AsyncEnumerableWrapper.cs
1
using System.Collections.Generic;
2
using System.Threading;
3
using System.Threading.Tasks;
4

5
namespace NetFabric.Reflection;
6

7
public sealed class AsyncEnumerableWrapper<TEnumerable, TItem>
8
    : IAsyncEnumerable<TItem>
9
    where TEnumerable : notnull
10
{
11
    public AsyncEnumerableWrapper(TEnumerable instance, AsyncEnumerableInfo info)
×
12
    {
13
        Instance = instance;
×
14
        Info = info;
×
15
    }
×
16

17
    public TEnumerable Instance { get; }
×
18
    public AsyncEnumerableInfo Info { get; }
×
19

20
    public IAsyncEnumerator<TItem> GetAsyncEnumerator(CancellationToken token) 
21
        => new Enumerator(this, token);
×
22

23
    sealed class Enumerator 
24
        : IAsyncEnumerator<TItem>
25
    {
26
        readonly AsyncEnumeratorInfo info;
27
        readonly object instance;
28

29
        public Enumerator(AsyncEnumerableWrapper<TEnumerable, TItem> enumerable, CancellationToken token)
×
30
        {
31
            info = enumerable.Info.EnumeratorInfo;
×
32
            instance = enumerable.Info.InvokeGetAsyncEnumerator(enumerable.Instance, token);
×
33
        }
×
34

35
        public TItem Current 
36
            => (TItem)info.GetValueCurrent(instance)!;
×
37

38
        public ValueTask<bool> MoveNextAsync() 
39
            => info.InvokeMoveNextAsync(instance);
×
40

41
        public ValueTask DisposeAsync()
42
            => info.DisposeAsync is not null 
×
43
                ? info.InvokeDisposeAsync(instance) 
×
44
                : default;
×
45
    }
46
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc