< Summary

Information
Class: MyNet.Text.TextPipeline
Assembly: MyNet.Text
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Text/TextPipeline.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 34
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
Apply(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Text/TextPipeline.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="TextPipeline.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.Globalization;
 8
 9namespace MyNet.Text;
 10
 11/// <summary>
 12/// A pipeline for applying multiple text transformations in sequence. This class allows you to chain multiple transform
 13/// </summary>
 14/// <param name="value">The initial string value for the pipeline.</param>
 15/// <param name="culture">The culture to use for culture-specific transformations.</param>
 16public sealed class TextPipeline(string value, CultureInfo culture)
 17{
 18    /// <summary>
 19    /// Gets the current value of the text after applying transformations. This property holds the result of the transfo
 20    /// </summary>
 21    public string Value { get; private set; } = value;
 22
 23    /// <summary>
 24    /// Applies a text transformation to the current value in the pipeline. This method takes an implementation of the I
 25    /// </summary>
 26    /// <param name="transform">The text transformation to apply.</param>
 27    /// <returns>The TextPipeline instance with the applied transformation.</returns>
 28    public TextPipeline Apply(ITextTransform transform)
 29    {
 3630        Value = transform.Apply(Value, culture);
 3631        return this;
 32    }
 33}
 34