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

LBreedlove / Queuebal.Expressions / 15762496729

19 Jun 2025 04:30PM UTC coverage: 88.035% (-1.6%) from 89.614%
15762496729

push

github

LBreedlove
Change Expression references to IExpression

260 of 285 branches covered (91.23%)

Branch coverage included in aggregate %.

16 of 48 new or added lines in 13 files covered. (33.33%)

1528 of 1746 relevant lines covered (87.51%)

196.65 hits per line

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

4.0
/Queuebal.Expressions.Mutations/StringSplitMutation.cs
1
using Queuebal.Json;
2

3
namespace Queuebal.Expressions.Mutations;
4

5

6
public class StringSplitMutation : Mutation
7
{
8
    public static string MutationType => "StringSplit";
1✔
9

10
    /// <summary>
11
    /// The separators used to split the string.
12
    /// </summary>
NEW
13
    public required List<string> Separators { get; set; }
×
14

15
    /// <summary>
16
    /// If true, empty entries will be removed from the result.
17
    /// </summary>
NEW
18
    public bool RemoveEmptyEntries { get; set; } = false;
×
19

20
    /// <summary>
21
    /// If true, leading and trailing whitespace will be removed from each entry in the result.
22
    /// This is applied after splitting the string.
23
    /// If RemoveEmptyEntries is true, this will also remove entries that are only whitespace.
24
    /// </summary>
NEW
25
    public bool TrimEntries { get; set; } = false;
×
26

27
    protected override JSONValue EvaluateMutation(ExpressionContext context, JSONValue inputValue)
NEW
28
    {
×
NEW
29
        if (!inputValue.IsString)
×
NEW
30
        {
×
NEW
31
            throw new InvalidOperationException("StringSplitMutation can only be applied to a string input value.");
×
32
        }
33

NEW
34
        var splitOptions = StringSplitOptions.None;
×
NEW
35
        if (RemoveEmptyEntries)
×
NEW
36
        {
×
NEW
37
            splitOptions |= StringSplitOptions.RemoveEmptyEntries;
×
NEW
38
        }
×
39

NEW
40
        if (TrimEntries)
×
NEW
41
        {
×
NEW
42
            splitOptions |= StringSplitOptions.TrimEntries;
×
NEW
43
        }
×
44

NEW
45
        return inputValue.StringValue
×
NEW
46
            .Split(Separators.Select(s => s[0]).ToArray(), splitOptions)
×
NEW
47
            .Select(s => new JSONValue(s))
×
NEW
48
            .ToList();
×
NEW
49
    }
×
50
}
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