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

AlamoEngine-Tools / PetroglyphTools / 8245696954

12 Mar 2024 08:25AM UTC coverage: 75.37% (+1.6%) from 73.737%
8245696954

Pull #387

github

web-flow
Merge a1af13080 into f4ad7514b
Pull Request #387: Use CommonUtilites as dependency

636 of 750 branches covered (84.8%)

Branch coverage included in aggregate %.

24 of 27 new or added lines in 9 files covered. (88.89%)

15 existing lines in 4 files now uncovered.

1607 of 2226 relevant lines covered (72.19%)

75.91 hits per line

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

0.0
/PG.Testing/CollectionAssertExtensions.cs
1
using System.Collections.Generic;
2
using System.Linq;
3
using Microsoft.VisualStudio.TestTools.UnitTesting;
4

5
namespace PG.Testing;
6

7
public static class CollectionAssertExtensions
8
{
9
    public static void EqualUnordered<T>(ICollection<T>? expected, ICollection<T>? actual)
10
    {
UNCOV
11
        Assert.AreEqual(expected is null, actual is null);
×
UNCOV
12
        if (expected == null)
×
13
            return;
×
14

15
        // Lookups are an aggregated collections (enumerable contents), but ordered.
UNCOV
16
        var e = expected.Cast<object>().ToLookup(key => key);
×
UNCOV
17
        var a = actual!.Cast<object>().ToLookup(key => key);
×
18

19
        // Dictionaries can't handle null keys, which is a possibility
UNCOV
20
        CollectionAssert.AreEqual(e.Where(kv => kv.Key != null).ToDictionary(g => g.Key, g => g.Count()),
×
UNCOV
21
            a.Where(kv => kv.Key != null).ToDictionary(g => g.Key, g => g.Count()));
×
22

23
        // Get count of null keys.  Returns an empty sequence (and thus a 0 count) if no null key
UNCOV
24
        Assert.AreEqual(e[null!].Count(), a[null!].Count());
×
UNCOV
25
    }
×
26
}
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