< Summary

Information
Class: Trailblazer.Support.OrderedLifecycleHook
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Support/LifecycleHooks/OrderedLifecycleHook.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 39
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%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Support/LifecycleHooks/OrderedLifecycleHook.cs

#LineLine coverage
 1using System;
 2
 3namespace Trailblazer.Support;
 4
 5/// <summary>
 6/// Represents a lifecycle hook with an associated owner, execution order, and callback action.
 7/// </summary>
 8public sealed class OrderedLifecycleHook
 9{
 10    /// <summary>
 11    /// Initializes a new instance of the OrderedLifecycleHook class with the specified owner, order, and callback.
 12    /// </summary>
 13    /// <param name="owner">The owner of the lifecycle hook.</param>
 14    /// <param name="order">The execution order of the lifecycle hook.</param>
 15    /// <param name="callback">The callback action to be invoked for the lifecycle hook.</param>
 1216    public OrderedLifecycleHook(string owner, int order, Action callback)
 17    {
 1218        Owner = owner;
 1219        Order = order;
 1220        Callback = callback;
 1221    }
 22
 23    /// <summary>
 24    /// Gets the owner of the lifecycle hook, which is used to identify and manage the hook within the system.
 25    /// </summary>
 26    public string Owner { get; }
 27
 28    /// <summary>
 29    /// Gets the execution order of the lifecycle hook, determining the sequence in which it will be invoked relative to
 30    /// Hooks with lower order values will be executed before those with higher values.
 31    /// </summary>
 32    public int Order { get; }
 33
 34    /// <summary>
 35    /// Gets the callback action associated with the lifecycle hook, which will be invoked when the hook is executed.
 36    /// This action defines the behavior that will occur when the lifecycle event associated with the hook is triggered.
 37    /// </summary>
 38    public Action Callback { get; }
 39}