From 555e56fdfb02932f8bab68d2532034517152bb32 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Thu, 25 Jun 2026 11:12:52 -0400 Subject: [PATCH] test(gateway): drop inline GalaxyAlarmAttributeMappingTests (owned upstream by lib 0.2.0) The package's ZB.MOM.WW.GalaxyRepository namespace shadows the bare 'GalaxyRepository' class reference in this inline test (CS0234). The lib now owns the identical mapping test, so remove the duplicate (pulls one file of Task 10's test reconciliation forward to keep Tests compiling). --- .../GalaxyAlarmAttributeMappingTests.cs | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 src/ZB.MOM.WW.MxGateway.Tests/Galaxy/GalaxyAlarmAttributeMappingTests.cs diff --git a/src/ZB.MOM.WW.MxGateway.Tests/Galaxy/GalaxyAlarmAttributeMappingTests.cs b/src/ZB.MOM.WW.MxGateway.Tests/Galaxy/GalaxyAlarmAttributeMappingTests.cs deleted file mode 100644 index b02ae02..0000000 --- a/src/ZB.MOM.WW.MxGateway.Tests/Galaxy/GalaxyAlarmAttributeMappingTests.cs +++ /dev/null @@ -1,68 +0,0 @@ -using ZB.MOM.WW.MxGateway.Server.Galaxy; - -namespace ZB.MOM.WW.MxGateway.Tests.Galaxy; - -/// -/// Pure mapper tests for . These assert the -/// FullTagReference / SourceObjectReference derivation produced by -/// AlarmAttributesSql without touching a database: the SQL projects -/// tag_name as the source object and tag_name + '.' + attribute_name as -/// the full reference, exactly as AttributesSql does. -/// -public sealed class GalaxyAlarmAttributeMappingTests -{ - /// Verifies the mapper copies all projected columns onto the row. - [Fact] - public void MapAlarmRow_CopiesProjectedColumns() - { - GalaxyAlarmAttributeRow row = GalaxyRepository.MapAlarmRow( - fullTagReference: "Tank01.Level.HiHi", - sourceObjectReference: "Tank01", - area: "TestArea"); - - Assert.Equal("Tank01.Level.HiHi", row.FullTagReference); - Assert.Equal("Tank01", row.SourceObjectReference); - Assert.Equal("TestArea", row.Area); - } - - /// - /// Verifies is always empty: - /// the schema does not expose an ack-comment address, so the watch-list resolver - /// composes it later from configuration. - /// - [Fact] - public void MapAlarmRow_LeavesAckCommentSubtagEmpty() - { - GalaxyAlarmAttributeRow row = GalaxyRepository.MapAlarmRow( - fullTagReference: "Tank01.Level.HiHi", - sourceObjectReference: "Tank01", - area: "TestArea"); - - Assert.Equal(string.Empty, row.AckCommentSubtag); - } - - /// - /// Verifies the SourceObjectReference is the owning object (the SQL tag_name), - /// i.e. the segment that precedes the first attribute dot in the full reference, even - /// when the attribute itself is a multi-segment extension path. - /// - [Theory] - [InlineData("Tank01", "Level.HiHi", "Tank01.Level.HiHi")] - [InlineData("Pump_001", "Speed", "Pump_001.Speed")] - [InlineData("TestAlarm001", "Alarm001", "TestAlarm001.Alarm001")] - public void MapAlarmRow_SourceObjectIsSegmentBeforeFirstAttributeDot( - string tagName, - string attributeName, - string expectedFullReference) - { - // Mirror the AlarmAttributesSql projection: full_tag_reference = tag_name + '.' + attribute_name. - string fullTagReference = tagName + "." + attributeName; - - GalaxyAlarmAttributeRow row = GalaxyRepository.MapAlarmRow(fullTagReference, tagName, area: "TestArea"); - - Assert.Equal(expectedFullReference, row.FullTagReference); - Assert.Equal(tagName, row.SourceObjectReference); - Assert.Equal("TestArea", row.Area); - Assert.Equal(row.FullTagReference, row.SourceObjectReference + "." + attributeName); - } -}