< Summary

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

File(s)

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

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="KebabCasingTransform.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System;
 8using System.Globalization;
 9
 10namespace MyNet.Text.TextCasing;
 11
 12/// <summary>
 13/// Transforms a string to kebab-case.
 14/// </summary>
 15public sealed class KebabCasingTransform : ITextCasingTransform
 16{
 17    /// <summary>
 18    /// Initializes a new instance of the <see cref="KebabCasingTransform"/> class.
 19    /// </summary>
 620    internal KebabCasingTransform() { }
 21
 22    /// <inheritdoc/>
 23    public string Apply(string input, CultureInfo culture)
 24    {
 3025        ArgumentNullException.ThrowIfNull(input);
 3026        ArgumentNullException.ThrowIfNull(culture);
 27
 3028        var snake = new SnakeCasingTransform().Apply(input, culture);
 3029        return snake.Replace('_', '-');
 30    }
 31}
 32