< Summary

Information
Class: AmbientServices.Utilities.ImmutableArrayUtilities
Assembly: AmbientServices
File(s): /home/runner/work/AmbientServices/AmbientServices/AmbientServices/Utilities/ImmutableArrayUtilities.cs
Tag: 332_35464845198
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 25
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FromEnumerable<T>(...)100%11100%

File(s)

/home/runner/work/AmbientServices/AmbientServices/AmbientServices/Utilities/ImmutableArrayUtilities.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Collections.Immutable;
 3
 4namespace AmbientServices.Utilities;
 5
 6/// <summary>
 7/// A static class that contains utilities for <see cref="ImmutableArray{T}"/>.
 8/// </summary>
 9/// <remarks>
 10/// <pitch>Builds an <see cref="ImmutableArray{T}"/> from any <see cref="IEnumerable{T}"/> uniformly across target frame
 11/// </remarks>
 12internal static class ImmutableArrayUtilities
 13{
 14    /// <summary>
 15    /// Creates an <see cref="ImmutableArray{T}"/> from an <see cref="IEnumerable{T}"/>.
 16    /// </summary>
 17    /// <typeparam name="T">The type in the enumerable and array.</typeparam>
 18    /// <param name="source">The source enumeration.</param>
 19    /// <returns></returns>
 20    public static ImmutableArray<T> FromEnumerable<T>(IEnumerable<T> source)
 21    {
 222        ImmutableArray<T> ret = ImmutableArray<T>.Empty;
 223        return ret.AddRange(source);
 24    }
 25}