< Summary - SonghayCore

Information
Class: Songhay.Extensions.CharExtensions
Assembly: SonghayCore
File(s): /home/rasx/sourceRoot/SonghayCore/SonghayCore/Extensions/CharExtensions.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 21
Line coverage: 100%
Branch coverage
66%
Covered branches: 4
Total branches: 6
Branch coverage: 66.6%
Method coverage

Method coverage is only available for sponsors.

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
FromCharsToString(...)66.66%6100%

File(s)

/home/rasx/sourceRoot/SonghayCore/SonghayCore/Extensions/CharExtensions.cs

#LineLine coverage
 1namespace Songhay.Extensions;
 2
 3/// <summary>
 4/// Extension of <see cref="char"/>.
 5/// </summary>
 6public static class CharExtensions
 7{
 8    /// <summary>
 9    /// Converts an enumeration of <see cref="char"/>
 10    /// to <see cref="string"/>.
 11    /// </summary>
 12    /// <param name="chars">The <see cref="IEnumerable{T}"/> of <see cref="char"/>.</param>
 13    public static string? FromCharsToString(this IEnumerable<char>? chars)
 214    {
 215        if (chars == null) return null;
 16
 217        var charArray = chars as char[] ?? chars.ToArray();
 18
 219        return !charArray.Any() ? string.Empty : new string(charArray);
 220    }
 21}