< Summary

Information
Class: Chronicler.RecordLinks
Assembly: Chronicler
File(s): /home/runner/work/Chronicler/Chronicler/src/Chronicler/Links/RecordLinks.cs
Line coverage
100%
Covered lines: 13
Uncovered lines: 0
Coverable lines: 13
Total lines: 38
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Look(...)100%11100%
LookDeferred(...)100%22100%

File(s)

/home/runner/work/Chronicler/Chronicler/src/Chronicler/Links/RecordLinks.cs

#LineLine coverage
 1using System;
 2
 3namespace Chronicler;
 4
 5/// <summary>
 6/// Helper for reading and writing stable links to external or runtime-owned objects during a chronicler pass.
 7/// </summary>
 8public static class RecordLinks
 9{
 10    /// <summary>
 11    /// Reads or writes a named external link that must resolve during the current load pass.
 12    /// </summary>
 13    public static void Look<T>(IChronicler chronicler, ref T value, string name, string? slot = null)
 2414    {
 2415        chronicler.LookLink(ref value, name, slot);
 2016    }
 17
 18    /// <summary>
 19    /// Reads or writes a named external link that may resolve after the current load graph finishes.
 20    /// </summary>
 21    public static void LookDeferred<T>(
 22        IChronicler chronicler,
 23        T value,
 24        string name,
 25        Action<T> assignLoadedValue,
 26        string? slot = null)
 1727    {
 1728        if (assignLoadedValue == null)
 129            throw new ArgumentNullException(nameof(assignLoadedValue));
 30
 1631        chronicler.LookLink(
 1632            ref value,
 1633            name,
 1634            slot,
 1635            RecordLinkResolveMode.Deferred,
 1636            assignLoadedValue);
 1637    }
 38}