Replace direct SQL queries against Historian Runtime database with the Wonderware Historian managed SDK (ArchestrA.HistorianAccess). Add HistoryServerCapabilities node, AggregateFunctions folder, continuation points, ReadAtTime interpolation, ReturnBounds, ReadModified rejection, HistoricalDataConfiguration per node, historical event access, and client-side StandardDeviation aggregate support. Remove screenshot tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using Opc.Ua;
|
|
using Shouldly;
|
|
using Xunit;
|
|
using ZB.MOM.WW.LmxOpcUa.Host.Historian;
|
|
|
|
namespace ZB.MOM.WW.LmxOpcUa.Tests.Historian
|
|
{
|
|
public class HistorianDataSourceTests
|
|
{
|
|
[Fact]
|
|
public void MapAggregateToColumn_Average_ReturnsAverage()
|
|
{
|
|
HistorianDataSource.MapAggregateToColumn(ObjectIds.AggregateFunction_Average).ShouldBe("Average");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Minimum_ReturnsMinimum()
|
|
{
|
|
HistorianDataSource.MapAggregateToColumn(ObjectIds.AggregateFunction_Minimum).ShouldBe("Minimum");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Maximum_ReturnsMaximum()
|
|
{
|
|
HistorianDataSource.MapAggregateToColumn(ObjectIds.AggregateFunction_Maximum).ShouldBe("Maximum");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Count_ReturnsValueCount()
|
|
{
|
|
HistorianDataSource.MapAggregateToColumn(ObjectIds.AggregateFunction_Count).ShouldBe("ValueCount");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Start_ReturnsFirst()
|
|
{
|
|
HistorianDataSource.MapAggregateToColumn(ObjectIds.AggregateFunction_Start).ShouldBe("First");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_End_ReturnsLast()
|
|
{
|
|
HistorianDataSource.MapAggregateToColumn(ObjectIds.AggregateFunction_End).ShouldBe("Last");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_StdDev_ReturnsStdDev()
|
|
{
|
|
HistorianDataSource.MapAggregateToColumn(ObjectIds.AggregateFunction_StandardDeviationPopulation)
|
|
.ShouldBe("StdDev");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Unsupported_ReturnsNull()
|
|
{
|
|
HistorianDataSource.MapAggregateToColumn(new NodeId(99999)).ShouldBeNull();
|
|
}
|
|
}
|
|
}
|