Files
lmxopcua/tests/Server/ZB.MOM.WW.OtOpcUa.AdminUI.Tests/Uns/UnsTreeServiceEquipmentChildRowsTests.cs
T
Joseph Doherty 4cfa369354 refactor(adminui): delete the dead LoadTagsForEquipmentAsync surface (R04 S4)
v3 retired the equipment-Tag binding; IUnsTreeService.LoadTagsForEquipmentAsync
always returned empty, had no production caller, and EquipmentTagRow plus the
always-zero tagCounts / EquipmentRow.TagCount plumbing existed only to feed it.
All removed; the equipment badge count (virtual tags) is unchanged.

Refs #745
Claude-Session: https://claude.ai/code/session_01Ub9hGmYLQvn9XETzw7CMsT
2026-10-22 17:54:53 -04:00

30 lines
1016 B
C#

using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.AdminUI.Uns;
namespace ZB.MOM.WW.OtOpcUa.AdminUI.Tests.Uns;
[Trait("Category", "Unit")]
public sealed class UnsTreeServiceEquipmentChildRowsTests
{
private static UnsTreeService SeededService()
{
var dbName = $"uns-childrows-{Guid.NewGuid():N}";
UnsTreeTestDb.SeedNamed(dbName);
return new UnsTreeService(UnsTreeTestDb.Factory(dbName));
}
// v3 Batch-1 retired the equipment↔Tag binding; the always-empty LoadTagsForEquipmentAsync stub and
// its EquipmentTagRow were deleted (R04 S4). Equipment tags are UnsTagReference rows now.
[Fact]
public async Task LoadVirtualTagsForEquipment_returns_vtags_in_name_order()
{
var rows = await SeededService().LoadVirtualTagsForEquipmentAsync(UnsTreeTestDb.SeededEquipmentId);
rows.Count.ShouldBe(1);
rows[0].VirtualTagId.ShouldBe("VTAG-1");
rows[0].Name.ShouldBe("computed");
rows[0].DataType.ShouldBe("Double");
}
}