test(opcua): assert alarm UA type across supported adapters

This commit is contained in:
Joseph Doherty
2026-11-10 11:02:27 -05:00
parent 09ac0e58cb
commit 344bc9df8a
2 changed files with 7 additions and 4 deletions
@@ -120,7 +120,8 @@ public sealed class NodeManagerAlarmSourceFieldsTests : IDisposable
var condition = nm.TryGetAlarmCondition("alm-x", AddressSpaceRealm.Uns); var condition = nm.TryGetAlarmCondition("alm-x", AddressSpaceRealm.Uns);
condition.ShouldNotBeNull(); condition.ShouldNotBeNull();
condition.GetType().ShouldBe(typeof(AlarmConditionState)); // base-type fallback condition.ShouldBeAssignableTo<AlarmConditionState>();
condition.TypeDefinitionId.ShouldBe(ObjectTypeIds.AlarmConditionType);
condition.EventType!.Value.ShouldBe(ObjectTypeIds.AlarmConditionType); condition.EventType!.Value.ShouldBe(ObjectTypeIds.AlarmConditionType);
} }
@@ -369,8 +369,9 @@ public sealed class SdkAddressSpaceSinkTests : IDisposable
var condition = nm.TryGetAlarmCondition("alm-x"); var condition = nm.TryGetAlarmCondition("alm-x");
condition.ShouldNotBeNull(); condition.ShouldNotBeNull();
// Base type exactly — NOT a LimitAlarmState (no limits to populate for a script alarm). // The supported method adapter preserves the base UA type (there are no script limits).
condition.GetType().ShouldBe(typeof(AlarmConditionState)); condition.ShouldBeAssignableTo<AlarmConditionState>();
condition.TypeDefinitionId.ShouldBe(ObjectTypeIds.AlarmConditionType);
await host.DisposeAsync(); await host.DisposeAsync();
} }
@@ -437,7 +438,8 @@ public sealed class SdkAddressSpaceSinkTests : IDisposable
var condition = nm.TryGetAlarmCondition("alm-base"); var condition = nm.TryGetAlarmCondition("alm-base");
condition.ShouldNotBeNull(); condition.ShouldNotBeNull();
condition.GetType().ShouldBe(typeof(AlarmConditionState)); // base type condition.ShouldBeAssignableTo<AlarmConditionState>();
condition.TypeDefinitionId.ShouldBe(ObjectTypeIds.AlarmConditionType);
// Simulate a build where the optional Confirm sub-state machine was NOT created. // Simulate a build where the optional Confirm sub-state machine was NOT created.
condition.ConfirmedState = null; condition.ConfirmedState = null;