fix(template-engine): computed-alarm IsMesReportable in revision hash and diff, true-only (ScadaBridge#102 item 2)
Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -230,6 +230,28 @@ public class DiffServiceTests
|
||||
Assert.Equal(DiffChangeType.Changed, diff.AlarmChanges[0].ChangeType);
|
||||
}
|
||||
|
||||
/// <summary>Gitea #102: flipping a computed alarm's MES-reportable flag is a diff.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_AlarmIsMesReportableChange_DetectedAsChanged()
|
||||
{
|
||||
var oldConfig = new FlattenedConfiguration
|
||||
{
|
||||
InstanceUniqueName = "Instance1",
|
||||
Alarms = [new ResolvedAlarm { CanonicalName = "HighTemp", TriggerType = "RangeViolation" }]
|
||||
};
|
||||
var newConfig = new FlattenedConfiguration
|
||||
{
|
||||
InstanceUniqueName = "Instance1",
|
||||
Alarms = [new ResolvedAlarm { CanonicalName = "HighTemp", TriggerType = "RangeViolation", IsMesReportable = true }]
|
||||
};
|
||||
|
||||
var diff = _sut.ComputeDiff(oldConfig, newConfig);
|
||||
|
||||
Assert.True(diff.HasChanges);
|
||||
Assert.Single(diff.AlarmChanges);
|
||||
Assert.Equal(DiffChangeType.Changed, diff.AlarmChanges[0].ChangeType);
|
||||
}
|
||||
|
||||
/// <summary>Verifies that a native alarm source reference change is detected as changed.</summary>
|
||||
[Fact]
|
||||
public void ComputeDiff_NativeAlarmSourceReferenceChange_DetectedAsChanged()
|
||||
|
||||
Reference in New Issue
Block a user