test(grpc-data): A2b U — method bits authorable, shelve not, Galaxy opt-in default off

This commit is contained in:
Joseph Doherty
2026-11-24 13:43:28 -05:00
parent 8d5077c07d
commit a75d15ad5d
2 changed files with 10 additions and 5 deletions
@@ -12,11 +12,16 @@ namespace ZB.MOM.WW.OtOpcUa.AdminUI.Tests.DataConnections;
public sealed class GrpcDataConditionEditorTests
{
[Fact]
public void AlarmSubscribe_is_authorable_and_the_method_bits_are_not()
public void AlarmSubscribe_and_the_A2b_method_bits_are_authorable_and_shelve_is_not()
{
DataOperationAuthoring.AuthorableOperations.ShouldContain(DataOperations.AlarmSubscribe);
foreach (var bit in new[] { DataOperations.AlarmAcknowledge, DataOperations.AlarmConfirm, DataOperations.AlarmShelve })
DataOperationAuthoring.AuthorableOperations.ShouldNotContain(bit, "A2b");
DataOperationAuthoring.AuthorableOperations.ShouldContain(DataOperations.AlarmAcknowledge);
DataOperationAuthoring.AuthorableOperations.ShouldContain(DataOperations.AlarmConfirm);
DataOperationAuthoring.AuthorableOperations.ShouldNotContain(DataOperations.AlarmShelve, "deferred shelve methods");
DataOperationAuthoring.Label(DataOperations.AlarmAcknowledge).ShouldBe("AlarmAcknowledge");
new DataConnectionEditorModel().Value.AllowedOperations.HasFlag(DataOperations.AlarmAcknowledge).ShouldBeFalse();
new RemoteMappingEditorModel().Value.AllowedOperations.HasFlag(DataOperations.AlarmConfirm).ShouldBeFalse();
new DataExport().AllowGalaxyServiceAck.ShouldBeFalse("the Galaxy opt-in defaults off (§6)");
// Every authorable bit is one the validator accepts and the node understands.
var all = DataOperationAuthoring.AuthorableOperations.Aggregate(DataOperations.None, (a, b) => a | b);
(all & ~DataOperationSets.Understood).ShouldBe(DataOperations.None);
@@ -14,8 +14,8 @@ public sealed class GrpcDataHistoryEditorTests
public void HistoryRead_is_authorable_and_new_drafts_do_not_grant_it()
{
DataOperationAuthoring.AuthorableOperations.ShouldContain(DataOperations.HistoryRead);
// A2a made AlarmSubscribe authorable (GrpcDataConditionEditorTests); the method bits stay unauthorable until A2b.
DataOperationAuthoring.AuthorableOperations.ShouldNotContain(DataOperations.AlarmAcknowledge, "A2b bits stay unauthorable");
// A2a/A2b made the alarm bits authorable (GrpcDataConditionEditorTests); AlarmShelve stays unauthorable.
DataOperationAuthoring.AuthorableOperations.ShouldNotContain(DataOperations.AlarmShelve, "the shelve bit stays reserved");
// Every authorable bit is one the validator accepts — the editor never gets ahead of authoring.
var all = DataOperationAuthoring.AuthorableOperations.Aggregate(DataOperations.None, (a, b) => a | b);
(all & ~DataOperationSets.Understood).ShouldBe(DataOperations.None);