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

luttje / Key2Joy / 6518072733

14 Oct 2023 01:54PM UTC coverage: 12.718% (+0.2%) from 12.469%
6518072733

push

github

luttje
add release workflow (squash)

185 of 1687 branches covered (0.0%)

Branch coverage included in aggregate %.

813 of 6160 relevant lines covered (13.2%)

7714.49 hits per line

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

81.25
/Core/Key2Joy.Core/Mapping/ExposedEnumerationRepository.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Reflection;
5
using Key2Joy.Contracts.Mapping;
6

7
namespace Key2Joy.Mapping;
8

9
public static class ExposedEnumerationRepository
10
{
11
    private static List<ExposedEnumeration> exposedEnumerations;
12

13
    /// <summary>
14
    /// Check all types for the ExposedEnumeration attribute and store them for later use. Optionally merging it with additional enumerations.
15
    /// </summary>
16
    /// <param name="additionalExposedEnumerations"></param>
17
    public static void Buffer(IReadOnlyList<ExposedEnumeration> additionalExposedEnumerations = null)
18
    {
19
        exposedEnumerations = new();
1✔
20

21
        foreach (var type in AppDomain.CurrentDomain.GetAssemblies().SelectMany(a => a.GetTypes()))
31,410✔
22
        {
23
            var attributes = type.GetCustomAttributes<ExposesEnumerationAttribute>();
15,685✔
24

25
            foreach (var attribute in attributes)
31,384✔
26
            {
27
                exposedEnumerations.Add(ExposedEnumeration.FromType(attribute.EnumerationType));
7✔
28
            }
29
        }
30

31
        if (additionalExposedEnumerations == null)
1!
32
        {
33
            return;
1✔
34
        }
35

36
        exposedEnumerations.AddRange(additionalExposedEnumerations);
×
37
    }
×
38

39
    /// <summary>
40
    /// Gets all exposed enumerations
41
    /// </summary>
42
    /// <returns></returns>
43
    public static List<ExposedEnumeration> GetAllExposedEnumerations() => exposedEnumerations;
30✔
44
}
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