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

loresoft / MediatR.CommandQuery / 12567339125

01 Jan 2025 04:52AM UTC coverage: 60.229% (-0.1%) from 60.328%
12567339125

push

github

pwelter34
switch to Testcontainers

402 of 761 branches covered (52.83%)

Branch coverage included in aggregate %.

1282 of 2035 relevant lines covered (63.0%)

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

20
        var interfaceType = typeof(TInterface);
232✔
21

22
        if (!interfaceType.IsInterface)
232!
23
            throw new InvalidOperationException("Only interfaces can be implemented.");
×
24

25
        return interfaceType.IsAssignableFrom(type);
232✔
26
    }
27
}
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