Files
lmxopcua/tests/ZB.MOM.WW.LmxOpcUa.Tests/Domain/GalaxyAttributeInfoTests.cs
Joseph Doherty 72d7a21a9d Add ExtendedAttributes config toggle for system+user attributes
When GalaxyRepository.ExtendedAttributes is true, uses the extended
attributes query that includes both primitive (system) and dynamic
(user-defined) attributes. Default is false (dynamic only, preserving
existing behavior). Extended mode returns ~564 attributes vs ~48.

Adds PrimitiveName and AttributeSource fields to GalaxyAttributeInfo.
Includes 5 new unit tests and 6 new integration tests covering both
standard and extended attribute modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 06:05:55 -04:00

49 lines
1.3 KiB
C#

using Shouldly;
using Xunit;
using ZB.MOM.WW.LmxOpcUa.Host.Domain;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
{
public class GalaxyAttributeInfoTests
{
[Fact]
public void DefaultValues_AreEmpty()
{
var info = new GalaxyAttributeInfo();
info.PrimitiveName.ShouldBe("");
info.AttributeSource.ShouldBe("");
info.TagName.ShouldBe("");
info.AttributeName.ShouldBe("");
info.FullTagReference.ShouldBe("");
info.DataTypeName.ShouldBe("");
}
[Fact]
public void ExtendedFields_CanBeSet()
{
var info = new GalaxyAttributeInfo
{
PrimitiveName = "UDO",
AttributeSource = "primitive"
};
info.PrimitiveName.ShouldBe("UDO");
info.AttributeSource.ShouldBe("primitive");
}
[Fact]
public void StandardAttributes_HaveEmptyExtendedFields()
{
var info = new GalaxyAttributeInfo
{
GobjectId = 1,
TagName = "TestObj",
AttributeName = "MachineID",
FullTagReference = "TestObj.MachineID",
MxDataType = 5
};
info.PrimitiveName.ShouldBe("");
info.AttributeSource.ShouldBe("");
}
}
}