< Summary

Information
Class: Elsa.Mediator.Middleware.Notification.NotificationContext
Assembly: Elsa.Mediator
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/Middleware/Notification/NotificationContext.cs
Line coverage
100%
Covered lines: 10
Uncovered lines: 0
Coverable lines: 10
Total lines: 44
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Notification()100%11100%
get_NotificationStrategy()100%11100%
get_ServiceProvider()100%11100%
get_CancellationToken()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/Middleware/Notification/NotificationContext.cs

#LineLine coverage
 1using Elsa.Mediator.Contracts;
 2
 3namespace Elsa.Mediator.Middleware.Notification;
 4
 5/// <summary>
 6/// Represents a context for a notification.
 7/// </summary>
 8public class NotificationContext
 9{
 10    /// <summary>
 11    /// Initializes a new instance of the <see cref="NotificationContext"/> class.
 12    /// </summary>
 13    /// <param name="notification">The notification to publish.</param>
 14    /// <param name="notificationStrategy">The publishing strategy to use.</param>
 15    /// <param name="serviceProvider">The service provider to resolve services from.</param>
 16    /// <param name="cancellationToken">The cancellation token.</param>
 1131617    public NotificationContext(INotification notification, IEventPublishingStrategy notificationStrategy, IServiceProvid
 18    {
 1131619        Notification = notification;
 1131620        NotificationStrategy = notificationStrategy;
 1131621        ServiceProvider = serviceProvider;
 1131622        CancellationToken = cancellationToken;
 1131623    }
 24
 25    /// <summary>
 26    /// Gets the notification to publish.
 27    /// </summary>
 4668128    public INotification Notification { get; init; }
 29
 30    /// <summary>
 31    /// Gets the publishing strategy to use.
 32    /// </summary>
 2263233    public IEventPublishingStrategy NotificationStrategy { get; init; }
 34
 35    /// <summary>
 36    /// Gets the service provider used for resolving dependencies within the notification context.
 37    /// </summary>
 1131638    public IServiceProvider ServiceProvider { get; }
 39
 40    /// <summary>
 41    /// Gets the cancellation token.
 42    /// </summary>
 3536543    public CancellationToken CancellationToken { get; init; }
 44}