< Summary - Kestrun — Combined Coverage

Information
Class: Kestrun.Logging.Utils.Console.Padding
Assembly: Kestrun
File(s): /home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Logging/Utils/Console/Padding.cs
Tag: Kestrun/Kestrun@9d3a582b2d63930269564a7591aa77ef297cadeb
Line coverage
60%
Covered lines: 6
Uncovered lines: 4
Coverable lines: 10
Total lines: 45
Line coverage: 60%
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

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Right()100%11100%
get_Left()100%11100%
.ctor(...)100%11100%
.ctor(...)100%210%
RightString()100%11100%
LeftString()100%11100%
PadString(...)100%11100%

File(s)

/home/runner/work/Kestrun/Kestrun/src/CSharp/Kestrun/Logging/Utils/Console/Padding.cs

#LineLine coverage
 1namespace Kestrun.Logging.Utils.Console;
 2
 3/// <summary>
 4/// Represents padding values for left and right sides, and provides methods to generate padding strings.
 5/// </summary>
 6public class Padding
 7{
 8    /// <summary>
 9    /// Gets or sets the padding value for the right side.
 10    /// </summary>
 6011    public int Right { get; set; }
 12    /// <summary>
 13    /// Gets or sets the padding value for the left side.
 14    /// </summary>
 6015    public int Left { get; set; }
 16
 17    /// <summary>
 18    /// Initializes a new instance of the <see cref="Padding"/> class with the same padding value for both left and righ
 19    /// </summary>
 20    /// <param name="all">The padding value to apply to both left and right sides.</param>
 1221    public Padding(int all) => Right = Left = all;
 22
 23    /// <summary>
 24    /// Initializes a new instance of the <see cref="Padding"/> class with specified right and left padding values.
 25    /// </summary>
 26    /// <param name="right">The padding value for the right side.</param>
 27    /// <param name="left">The padding value for the left side.</param>
 028    public Padding(int right, int left)
 29    {
 030        Right = right;
 031        Left = left;
 032    }
 33
 34    /// <summary>
 35    /// Returns a string consisting of spaces for the right padding.
 36    /// </summary>
 2637    public string RightString() => PadString(Right);
 38
 39    /// <summary>
 40    /// Returns a string consisting of spaces for the left padding.
 41    /// </summary>
 2642    public string LeftString() => PadString(Left);
 43
 5244    private static string PadString(int padding) => string.Concat(Enumerable.Repeat(' ', padding));
 45}