• 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

66.67
/NetFabric.Reflection/Reflection/EnumerableInfo.cs
1
using System.Reflection;
2

3
namespace NetFabric.Reflection;
4

5
/// <summary>
6
/// Contains information about methods and properties that ´foreach´ will use to enumerate a given type.
7
/// </summary>
8
public class EnumerableInfo
9
{
10
    /// <summary>
11
    /// Indicates if 'foreach' will use the indexer instead of the enumerator.
12
    /// </summary>
13
    public bool ForEachUsesIndexer { get; }
54✔
14

15
    /// <summary>
16
    /// Information on the method that 'foreach' will use to get a new instance of the enumerator.
17
    /// </summary>
18
    public MethodInfo GetEnumerator { get; }
121✔
19
    
20
    /// <summary>
21
    /// Information on the enumerator methods that 'foreach' will use.
22
    /// </summary>
23
    public EnumeratorInfo EnumeratorInfo { get; }
134✔
24

25
    internal EnumerableInfo(bool forEachUsesIndexer, MethodInfo getEnumerator, EnumeratorInfo enumeratorInfo)
73✔
26
    {
27
        ForEachUsesIndexer = forEachUsesIndexer;
73✔
28
        GetEnumerator = getEnumerator;
73✔
29
        EnumeratorInfo = enumeratorInfo;
73✔
30
    }
73✔
31

32
    public object InvokeGetEnumerator(object instance)
33
    {
34
        try
35
        {
36
            return GetEnumerator.Invoke(instance, null)!;
×
37
        }
38
        catch (TargetInvocationException exception)
×
39
        {
40
            throw new EnumerationException($"Unhandled exception in {GetEnumerator.DeclaringType!.Name}.GetEnumerator().", exception.InnerException!);
×
41
        }
42
    }
×
43
}
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

© 2026 Coveralls, Inc