feat: expose mapped raw and uns data through grpc adapters
This commit is contained in:
+21
@@ -46,6 +46,27 @@ public sealed class ScriptedAlarmHostActorTests : RuntimeActorTestBase
|
||||
/// </remarks>
|
||||
private static readonly TimeSpan Timeout = TimeSpan.FromSeconds(30);
|
||||
|
||||
[Fact]
|
||||
public void A_delayed_engine_emission_with_revoked_original_evidence_is_not_published()
|
||||
{
|
||||
var publish = CreateTestProbe(); var mux = CreateTestProbe();
|
||||
var (host, _) = Spawn(publish, mux);
|
||||
var evidence = new TestEvidence();
|
||||
var emission = new ScriptedAlarmEvent("alarm", "Plant", "Alarm", AlarmKind.AlarmCondition,
|
||||
ZB.MOM.WW.OtOpcUa.Core.Abstractions.AlarmSeverity.High, "message",
|
||||
AlarmConditionState.Fresh("alarm", DateTime.UtcNow), EmissionKind.QualityChanged, DateTime.UtcNow)
|
||||
{ InputEvidence = evidence };
|
||||
var type = typeof(ScriptedAlarmHostActor).GetNestedType("EngineEmission", System.Reflection.BindingFlags.NonPublic).ShouldNotBeNull();
|
||||
var message = Activator.CreateInstance(type, emission).ShouldNotBeNull();
|
||||
evidence.Valid = false;
|
||||
host.Tell(message);
|
||||
publish.ExpectNoMsg(TimeSpan.FromMilliseconds(250), TestContext.Current.CancellationToken);
|
||||
evidence.Valid = true;
|
||||
host.Tell(message);
|
||||
publish.ExpectMsg<OpcUaPublishActor.AlarmQualityUpdate>(Timeout, cancellationToken: TestContext.Current.CancellationToken);
|
||||
}
|
||||
private sealed class TestEvidence : IAlarmInputEvidence { public bool Valid = true; public bool IsValid => Valid; }
|
||||
|
||||
/// <summary>Plan whose predicate compares the single tag "M.T" against 90 — enabled by default.</summary>
|
||||
private static EquipmentScriptedAlarmPlan Plan(
|
||||
string id = "alm-1",
|
||||
|
||||
Reference in New Issue
Block a user