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

loresoft / MediatR.CommandQuery / 12567339125

01 Jan 2025 04:52AM UTC coverage: 60.229% (-0.1%) from 60.328%
12567339125

push

github

pwelter34
switch to Testcontainers

402 of 761 branches covered (52.83%)

Branch coverage included in aggregate %.

1282 of 2035 relevant lines covered (63.0%)

19.24 hits per line

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

0.0
/src/MediatR.CommandQuery/Extensions/StringExtensions.cs
1
using System.Diagnostics.CodeAnalysis;
2

3
namespace MediatR.CommandQuery.Extensions;
4

5
/// <summary>
6
/// <see cref="String"/> type extension methods
7
/// </summary>
8
public static class StringExtensions
9
{
10
    /// <summary>
11
    /// Combines two strings with the specified separator.
12
    /// </summary>
13
    /// <param name="first">The first string.</param>
14
    /// <param name="second">The second string.</param>
15
    /// <param name="separator">The separator string.</param>
16
    /// <returns>A string combining the <paramref name="first"/> and <paramref name="second"/> parameters with the <paramref name="separator"/> between them</returns>
17
    [return: NotNullIfNotNull(nameof(first))]
18
    [return: NotNullIfNotNull(nameof(second))]
19
    public static string? Combine(this string? first, string? second, char separator = '/')
20
    {
21
        if (string.IsNullOrEmpty(first))
×
22
            return second;
×
23

24
        if (string.IsNullOrEmpty(second))
×
25
            return first;
×
26

27
        bool hasSeparator = first[^1] == separator || second[0] == separator;
×
28

29
        return hasSeparator
×
30
            ? string.Concat(first, second)
×
31
            : $"{first}{separator}{second}";
×
32
    }
33
}
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