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

AlamoEngine-Tools / PetroglyphTools / 8252849769

12 Mar 2024 05:02PM UTC coverage: 74.489% (+0.8%) from 73.737%
8252849769

Pull #387

github

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

653 of 788 branches covered (82.87%)

Branch coverage included in aggregate %.

80 of 143 new or added lines in 17 files covered. (55.94%)

15 existing lines in 4 files now uncovered.

1645 of 2297 relevant lines covered (71.62%)

73.76 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