60 lines
1.9 KiB
C#
60 lines
1.9 KiB
C#
using Opc.Ua;
|
|
using Shouldly;
|
|
using Xunit;
|
|
using ZB.MOM.WW.OtOpcUa.Host.Historian;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.Tests.Historian
|
|
{
|
|
public class HistorianAggregateMapTests
|
|
{
|
|
[Fact]
|
|
public void MapAggregateToColumn_Average_ReturnsAverage()
|
|
{
|
|
HistorianAggregateMap.MapAggregateToColumn(ObjectIds.AggregateFunction_Average).ShouldBe("Average");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Minimum_ReturnsMinimum()
|
|
{
|
|
HistorianAggregateMap.MapAggregateToColumn(ObjectIds.AggregateFunction_Minimum).ShouldBe("Minimum");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Maximum_ReturnsMaximum()
|
|
{
|
|
HistorianAggregateMap.MapAggregateToColumn(ObjectIds.AggregateFunction_Maximum).ShouldBe("Maximum");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Count_ReturnsValueCount()
|
|
{
|
|
HistorianAggregateMap.MapAggregateToColumn(ObjectIds.AggregateFunction_Count).ShouldBe("ValueCount");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Start_ReturnsFirst()
|
|
{
|
|
HistorianAggregateMap.MapAggregateToColumn(ObjectIds.AggregateFunction_Start).ShouldBe("First");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_End_ReturnsLast()
|
|
{
|
|
HistorianAggregateMap.MapAggregateToColumn(ObjectIds.AggregateFunction_End).ShouldBe("Last");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_StdDev_ReturnsStdDev()
|
|
{
|
|
HistorianAggregateMap.MapAggregateToColumn(ObjectIds.AggregateFunction_StandardDeviationPopulation)
|
|
.ShouldBe("StdDev");
|
|
}
|
|
|
|
[Fact]
|
|
public void MapAggregateToColumn_Unsupported_ReturnsNull()
|
|
{
|
|
HistorianAggregateMap.MapAggregateToColumn(new NodeId(99999)).ShouldBeNull();
|
|
}
|
|
}
|
|
}
|