< Summary

Information
Class: MoreStructures.Utilities.StringValueEnumerable
Assembly: MoreStructures
File(s): /home/runner/work/MoreStructures/MoreStructures/MoreStructures/Utilities/StringValueEnumerable.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 31
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 Cyclomatic complexity Line coverage
.ctor(...)100%1100%
get_StringValue()100%1100%

File(s)

/home/runner/work/MoreStructures/MoreStructures/MoreStructures/Utilities/StringValueEnumerable.cs

#LineLine coverage
 1namespace MoreStructures.Utilities;
 2
 3/// <summary>
 4/// A <see cref="IValueEnumerable{T}"/> implementation, wrapping a <see cref="string"/>.
 5/// </summary>
 6/// <remarks>
 7/// Useful when a <see cref="string"/> property/field should be equatable to an <see cref="IEnumerable{T}"/> by value.
 8/// <br/>
 9/// For example, when a property or field is declared as <see cref="IEnumerable{T}"/> of <see cref="char"/>, and can be
 10/// assigned either a <see cref="string"/> or a generic <see cref="IEnumerable{T}"/>, and it has to be solely compared
 11/// by value (i.e. on the actual chars in the <see cref="string"/> and <see cref="IEnumerable{T}"/>).
 12/// </remarks>
 13public class StringValueEnumerable : ValueEnumerable<char>
 14{
 15    /// <summary>
 16    /// Builds a <see cref="ValueEnumerable{T}"/> around the provided <paramref name="stringValue"/>.
 17    /// </summary>
 18    /// <param name="stringValue">The string to wrap.</param>
 19    /// <remarks>
 20    /// Time and Space Complexity are O(1), as this constructor doesn't iterate over <paramref name="stringValue"/>.
 21    /// </remarks>
 433522    public StringValueEnumerable(string stringValue) : base(stringValue)
 433523    {
 433524        StringValue = stringValue;
 433525    }
 26
 27    /// <summary>
 28    /// The <see cref="string"/> value underlying this <see cref="IValueEnumerable{T}"/>.
 29    /// </summary>
 3348830    public string StringValue { get; }
 31}