using Shouldly;
using Xunit;
using ZB.MOM.WW.LmxOpcUa.Host.Domain;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Domain
{
///
/// Verifies default and extended-field behavior for Galaxy attribute metadata objects.
///
public class GalaxyAttributeInfoTests
{
///
/// Confirms that a default attribute metadata object starts with empty strings for its text fields.
///
[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("");
info.SecurityClassification.ShouldBe(1);
info.IsHistorized.ShouldBeFalse();
info.IsAlarm.ShouldBeFalse();
}
///
/// Confirms that primitive-name and attribute-source fields can be populated for extended metadata rows.
///
[Fact]
public void ExtendedFields_CanBeSet()
{
var info = new GalaxyAttributeInfo
{
PrimitiveName = "UDO",
AttributeSource = "primitive"
};
info.PrimitiveName.ShouldBe("UDO");
info.AttributeSource.ShouldBe("primitive");
}
///
/// Confirms that standard attribute rows leave the extended metadata fields empty.
///
[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("");
}
}
}