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

loresoft / MediatR.CommandQuery / 14067111219

25 Mar 2025 06:14PM UTC coverage: 59.397% (-0.5%) from 59.879%
14067111219

push

github

pwelter34
Update MediatorServiceExtensions.cs

495 of 971 branches covered (50.98%)

Branch coverage included in aggregate %.

0 of 3 new or added lines in 1 file covered. (0.0%)

113 existing lines in 15 files now uncovered.

1474 of 2344 relevant lines covered (62.88%)

22.57 hits per line

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

64.29
/src/MediatR.CommandQuery/Queries/EntitySort.cs
1
using System.Text.Json.Serialization;
2

3
namespace MediatR.CommandQuery.Queries;
4

5
public class EntitySort
6
{
7
    [JsonPropertyName("name")]
8
    public string Name { get; set; } = null!;
100✔
9

10
    [JsonPropertyName("direction")]
11
    [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
12
    public string? Direction { get; set; }
92✔
13

14

15
    public static EntitySort? Parse(string? sortString)
16
    {
17
        if (string.IsNullOrEmpty(sortString))
16✔
18
            return null;
4✔
19

20
        var parts = sortString.Split([':'], StringSplitOptions.RemoveEmptyEntries);
12✔
21
        if (parts is null || parts.Length == 0)
12!
UNCOV
22
            return null;
×
23

24
        var sort = new EntitySort();
12✔
25
        sort.Name = parts[0].Trim();
12✔
26

27
        if (parts.Length >= 2)
12✔
28
            sort.Direction = parts[1]?.Trim();
10!
29

30
        return sort;
12✔
31
    }
32

33

34
    public override int GetHashCode()
35
    {
UNCOV
36
        return HashCode.Combine(Name, Direction);
×
37
    }
38

39
    public override string ToString()
40
    {
41
        if (string.IsNullOrWhiteSpace(Direction))
×
UNCOV
42
            return Name;
×
43

UNCOV
44
        return $"{Name}:{Direction}";
×
45
    }
46
}
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