worker(alarms): synthetic GUID + degraded/source_provider on emitted transitions
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using ZB.MOM.WW.MxGateway.Worker.MxAccess;
|
||||
|
||||
namespace ZB.MOM.WW.MxGateway.Worker.Tests.MxAccess;
|
||||
|
||||
/// <summary>
|
||||
/// Unit tests for <see cref="SyntheticAlarmGuid"/>: the subtag-fallback
|
||||
/// path derives a deterministic GUID from the alarm reference, so identical
|
||||
/// references must collide and distinct references must not.
|
||||
/// </summary>
|
||||
public sealed class SyntheticAlarmGuidTests
|
||||
{
|
||||
/// <summary>Verifies the same reference yields the same GUID.</summary>
|
||||
[Fact]
|
||||
public void SameReference_SameGuid() =>
|
||||
Assert.Equal(SyntheticAlarmGuid.ForReference("A.B.C"), SyntheticAlarmGuid.ForReference("A.B.C"));
|
||||
|
||||
/// <summary>Verifies distinct references yield distinct GUIDs.</summary>
|
||||
[Fact]
|
||||
public void DifferentReference_DifferentGuid() =>
|
||||
Assert.NotEqual(SyntheticAlarmGuid.ForReference("A.B.C"), SyntheticAlarmGuid.ForReference("A.B.D"));
|
||||
|
||||
/// <summary>Verifies a reference produces a non-empty GUID.</summary>
|
||||
[Fact]
|
||||
public void Reference_ProducesNonEmptyGuid() =>
|
||||
Assert.NotEqual(Guid.Empty, SyntheticAlarmGuid.ForReference("A.B.C"));
|
||||
}
|
||||
Reference in New Issue
Block a user