• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

loresoft / FluentCommand / 8973726646

06 May 2024 06:14PM UTC coverage: 53.644% (-0.8%) from 54.48%
8973726646

push

github

pwelter34
fix test snapshots

1165 of 2845 branches covered (40.95%)

Branch coverage included in aggregate %.

3686 of 6198 relevant lines covered (59.47%)

697.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.0
/src/FluentCommand/Extensions/StringExtensions.cs
1
using System.Diagnostics.CodeAnalysis;
2

3
#nullable enable
4

5
namespace FluentCommand.Extensions;
6

7
/// <summary>
8
/// <see cref="T:String"/> extension methods
9
/// </summary>
10
public static class StringExtensions
11
{
12
    /// <summary>
13
    /// Indicates whether the specified String object is null or an empty string
14
    /// </summary>
15
    /// <param name="item">A String reference</param>
16
    /// <returns>
17
    ///     <c>true</c> if is null or empty; otherwise, <c>false</c>.
18
    /// </returns>
19
    public static bool IsNullOrEmpty([NotNullWhen(false)] this string? item)
20
    {
21
        return string.IsNullOrEmpty(item);
369✔
22
    }
23

24
    /// <summary>
25
    /// Indicates whether a specified string is null, empty, or consists only of white-space characters
26
    /// </summary>
27
    /// <param name="item">A String reference</param>
28
    /// <returns>
29
    ///      <c>true</c> if is null or empty; otherwise, <c>false</c>.
30
    /// </returns>
31
    public static bool IsNullOrWhiteSpace([NotNullWhen(false)] this string? item)
32
    {
33
        if (item == null)
1,983!
34
            return true;
×
35

36
        for (int i = 0; i < item.Length; i++)
3,966!
37
            if (!char.IsWhiteSpace(item[i]))
1,983!
38
                return false;
1,983✔
39

40
        return true;
×
41
    }
42

43
    /// <summary>
44
    /// Determines whether the specified string is not <see cref="IsNullOrEmpty"/>.
45
    /// </summary>
46
    /// <param name="value">The value to check.</param>
47
    /// <returns>
48
    ///   <c>true</c> if the specified <paramref name="value"/> is not <see cref="IsNullOrEmpty"/>; otherwise, <c>false</c>.
49
    /// </returns>
50
    public static bool HasValue([NotNullWhen(true)] this string? value)
51
    {
52
        return !string.IsNullOrEmpty(value);
2,949✔
53
    }
54

55
    /// <summary>
56
    /// Replaces the format item in a specified string with the string representation of a corresponding object in a specified array.
57
    /// </summary>
58
    /// <param name="format">A composite format string</param>
59
    /// <param name="args">An object array that contains zero or more objects to format</param>
60
    /// <returns>A copy of format in which the format items have been replaced by the string representation of the corresponding objects in args</returns>
61
    public static string FormatWith(this string format, params object?[] args)
62
    {
63
        return string.Format(format, args);
×
64
    }
65
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc