< Summary

Information
Class: RaidLoop.Core.GameEvent
Assembly: RaidLoop.Core
File(s): /home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Core/GameEventLog.cs
Line coverage
83%
Covered lines: 5
Uncovered lines: 1
Coverable lines: 6
Total lines: 42
Line coverage: 83.3%
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_EventName()100%11100%
get_RaidId()100%11100%
get_Items()100%11100%
get_Timestamp()100%210%
get_TotalValue()100%11100%

File(s)

/home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Core/GameEventLog.cs

#LineLine coverage
 1namespace RaidLoop.Core;
 2
 3public static class GameEventLog
 4{
 5    private static readonly List<GameEvent> Entries = [];
 6
 7    public static IReadOnlyList<GameEvent> Events => Entries;
 8
 9    public static string CurrentRaidId { get; private set; } = string.Empty;
 10
 11    public static void SetRaidContext(string raidId)
 12    {
 13        CurrentRaidId = raidId ?? string.Empty;
 14    }
 15
 16    public static void Append(GameEvent evt)
 17    {
 18        Entries.Add(evt);
 19    }
 20
 21    public static void Clear()
 22    {
 23        Entries.Clear();
 24        CurrentRaidId = string.Empty;
 25    }
 26
 27    public static IReadOnlyList<ItemSnapshot> CreateItemSnapshots(IEnumerable<Item> items)
 28    {
 29        return items
 30            .Select(item => new ItemSnapshot(item.ItemDefId, item.Type.ToString(), item.DisplayRarity.ToString(), item.V
 31            .ToList();
 32    }
 33}
 34
 1001535public sealed record GameEvent(
 436    string EventName,
 137    string RaidId,
 338    IReadOnlyList<ItemSnapshot> Items,
 039    DateTimeOffset Timestamp,
 1001640    int TotalValue = 0);
 41
 42public sealed record ItemSnapshot(int ItemDefId, string Category, string Rarity, int Value);