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);
|
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user