feat: add IGalaxyRepository.GetAlarmAttributesAsync + AlarmAttributesSql

This commit is contained in:
Joseph Doherty
2026-06-25 10:38:12 -04:00
parent da09be3127
commit 94218c936a
3 changed files with 90 additions and 1 deletions
@@ -12,14 +12,17 @@ internal sealed class FakeGalaxyRepository : IGalaxyRepository
{
private readonly IReadOnlyList<GalaxyHierarchyRow> _hierarchy;
private readonly IReadOnlyList<GalaxyAttributeRow> _attributes;
private readonly IReadOnlyList<GalaxyAlarmAttributeRow> _alarmAttributes;
public FakeGalaxyRepository(
IReadOnlyList<GalaxyHierarchyRow> hierarchy,
IReadOnlyList<GalaxyAttributeRow> attributes,
DateTime? deployTime)
DateTime? deployTime,
IReadOnlyList<GalaxyAlarmAttributeRow>? alarmAttributes = null)
{
_hierarchy = hierarchy;
_attributes = attributes;
_alarmAttributes = alarmAttributes ?? Array.Empty<GalaxyAlarmAttributeRow>();
DeployTime = deployTime;
}
@@ -33,6 +36,8 @@ internal sealed class FakeGalaxyRepository : IGalaxyRepository
public int AttributeReadCount { get; private set; }
public int AlarmAttributeReadCount { get; private set; }
public Task<bool> TestConnectionAsync(CancellationToken ct = default) =>
ThrowOnQuery is null ? Task.FromResult(true) : throw ThrowOnQuery;
@@ -67,6 +72,17 @@ internal sealed class FakeGalaxyRepository : IGalaxyRepository
AttributeReadCount++;
return Task.FromResult(_attributes.ToList());
}
public Task<List<GalaxyAlarmAttributeRow>> GetAlarmAttributesAsync(CancellationToken ct = default)
{
if (ThrowOnQuery is not null)
{
throw ThrowOnQuery;
}
AlarmAttributeReadCount++;
return Task.FromResult(_alarmAttributes.ToList());
}
}
/// <summary>Records published deploy events so tests can assert publication.</summary>