< Summary

Information
Class: Chronicler.DefaultSaver
Assembly: Chronicler
File(s): /home/runner/work/Chronicler/Chronicler/src/Chronicler/Support/DefaultSaver.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 66
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
Save()100%11100%
OnSave()100%11100%
EarlyApply()100%11100%
OnEarlyApply()100%11100%
Apply()100%11100%
OnApply()100%11100%
LateApply()100%11100%
OnLateApply()100%11100%

File(s)

/home/runner/work/Chronicler/Chronicler/src/Chronicler/Support/DefaultSaver.cs

#LineLine coverage
 1//=======================================================================
 2// DefaultSaver.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2024–present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8namespace Chronicler;
 9
 10/// <summary>
 11/// Provides a reusable save/apply lifecycle base for explicit state transfer helpers.
 12/// </summary>
 13public abstract class DefaultSaver
 14{
 15    /// <summary>
 16    /// Runs the save phase.
 17    /// </summary>
 18    public void Save()
 19    {
 220        OnSave();
 221    }
 22
 23    /// <summary>
 24    /// Called by <see cref="Save"/>.
 25    /// </summary>
 126    protected virtual void OnSave() { }
 27
 28    /// <summary>
 29    /// Runs the early apply phase.
 30    /// </summary>
 31    public void EarlyApply()
 32    {
 233        OnEarlyApply();
 234    }
 35
 36    /// <summary>
 37    /// Called by <see cref="EarlyApply"/>.
 38    /// </summary>
 139    protected virtual void OnEarlyApply() { }
 40
 41    /// <summary>
 42    /// Runs the apply phase.
 43    /// </summary>
 44    public void Apply()
 45    {
 246        OnApply();
 247    }
 48
 49    /// <summary>
 50    /// Called by <see cref="Apply"/>.
 51    /// </summary>
 152    protected virtual void OnApply() { }
 53
 54    /// <summary>
 55    /// Runs the late apply phase.
 56    /// </summary>
 57    public void LateApply()
 58    {
 259        OnLateApply();
 260    }
 61
 62    /// <summary>
 63    /// Called by <see cref="LateApply"/>.
 64    /// </summary>
 165    protected virtual void OnLateApply() { }
 66}