• 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/EnumerableWrapper.cs
1
using System.Collections;
2
using System.Collections.Generic;
3

4
namespace NetFabric.Reflection;
5

6
public sealed class EnumerableWrapper<TEnumerable, TItem>
7
    : IEnumerable<TItem>
8
    where TEnumerable : notnull
9
{
10
    public EnumerableWrapper(TEnumerable instance, EnumerableInfo info)
×
11
    {
12
        Instance = instance;
×
13
        Info = info;
×
14
    }
×
15

16
    public TEnumerable Instance { get; }
×
17
    public EnumerableInfo Info { get; }
×
18

19
    public IEnumerator<TItem> GetEnumerator() 
20
        => new Enumerator(this);
×
21
    IEnumerator IEnumerable.GetEnumerator() 
22
        => new Enumerator(this);
×
23

24
    sealed class Enumerator 
25
        : IEnumerator<TItem>
26
    {
27
        readonly EnumeratorInfo info;
28
        readonly object instance;
29

30
        public Enumerator(EnumerableWrapper<TEnumerable, TItem> enumerable)
×
31
        {
32
            info = enumerable.Info.EnumeratorInfo;
×
33
            instance = enumerable.Info.InvokeGetEnumerator(enumerable.Instance);
×
34
        }
×
35

36
        public TItem Current 
37
            => (TItem)info.InvokeGetCurrent(instance)!;
×
38
        object? IEnumerator.Current 
39
            => info.InvokeGetCurrent(instance);
×
40

41
        public bool MoveNext() 
42
            => info.InvokeMoveNext(instance);
×
43

44
        public void Reset()
45
        {
46
            if (info.Reset is not null)
×
47
                info.InvokeReset(instance);
×
48
        }
×
49

50
        public void Dispose()
51
        {
52
            if (info.Dispose is not null)
×
53
                info.InvokeDispose(instance);
×
54
        }
×
55
    }
56
}
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