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

loresoft / MediatR.CommandQuery / 11418431610

19 Oct 2024 02:43PM UTC coverage: 58.337% (+0.9%) from 57.424%
11418431610

push

github

pwelter34
add HybridCache, misc refactors

331 of 675 branches covered (49.04%)

Branch coverage included in aggregate %.

28 of 176 new or added lines in 24 files covered. (15.91%)

156 existing lines in 33 files now uncovered.

1163 of 1886 relevant lines covered (61.66%)

19.49 hits per line

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

71.43
/src/MediatR.CommandQuery/Extensions/TypeExtensions.cs
1
namespace MediatR.CommandQuery.Extensions;
2

3
public static class TypeExtensions
4
{
5
    /// <summary>
6
    /// Determines whether the specified type implements an interface.
7
    /// </summary>
8
    /// <typeparam name="TInterface">The type of the interface.</typeparam>
9
    /// <param name="type">The type to check.</param>
10
    /// <returns><c>true</c> if type implements the interface; otherwise <c>false</c></returns>
11
    /// <exception cref="InvalidOperationException">Only interfaces can be implemented.</exception>
12
    public static bool Implements<TInterface>(this Type type)
13
        where TInterface : class
14
    {
15
        ArgumentNullException.ThrowIfNull(type);
232✔
16

17
        var interfaceType = typeof(TInterface);
232✔
18

19
        if (!interfaceType.IsInterface)
232!
UNCOV
20
            throw new InvalidOperationException("Only interfaces can be implemented.");
×
21

22
        return interfaceType.IsAssignableFrom(type);
232✔
23
    }
24
}
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