test(opcua): assert alarm UA type across supported adapters
This commit is contained in:
+2
-1
@@ -120,7 +120,8 @@ public sealed class NodeManagerAlarmSourceFieldsTests : IDisposable
|
||||
|
||||
var condition = nm.TryGetAlarmCondition("alm-x", AddressSpaceRealm.Uns);
|
||||
condition.ShouldNotBeNull();
|
||||
condition.GetType().ShouldBe(typeof(AlarmConditionState)); // base-type fallback
|
||||
condition.ShouldBeAssignableTo<AlarmConditionState>();
|
||||
condition.TypeDefinitionId.ShouldBe(ObjectTypeIds.AlarmConditionType);
|
||||
condition.EventType!.Value.ShouldBe(ObjectTypeIds.AlarmConditionType);
|
||||
|
||||
}
|
||||
|
||||
@@ -369,8 +369,9 @@ public sealed class SdkAddressSpaceSinkTests : IDisposable
|
||||
|
||||
var condition = nm.TryGetAlarmCondition("alm-x");
|
||||
condition.ShouldNotBeNull();
|
||||
// Base type exactly — NOT a LimitAlarmState (no limits to populate for a script alarm).
|
||||
condition.GetType().ShouldBe(typeof(AlarmConditionState));
|
||||
// The supported method adapter preserves the base UA type (there are no script limits).
|
||||
condition.ShouldBeAssignableTo<AlarmConditionState>();
|
||||
condition.TypeDefinitionId.ShouldBe(ObjectTypeIds.AlarmConditionType);
|
||||
|
||||
await host.DisposeAsync();
|
||||
}
|
||||
@@ -437,7 +438,8 @@ public sealed class SdkAddressSpaceSinkTests : IDisposable
|
||||
|
||||
var condition = nm.TryGetAlarmCondition("alm-base");
|
||||
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.
|
||||
condition.ConfirmedState = null;
|
||||
|
||||
Reference in New Issue
Block a user