using Shouldly; using Xunit; using ZB.MOM.WW.OtOpcUa.Core.Abstractions; namespace ZB.MOM.WW.OtOpcUa.Driver.Historian.Sql.Common.Tests; /// The DB-free part of the former SQL Server integration ProcessedReadTests. public sealed class ProcessedReadTests { [Fact] public void Every_enum_member_is_either_served_or_refused() { // Seventeen served (#671 added TimeAverage, TimeAverage2, Interpolative and Total2, and moved Total to the // time-weighted family; #680 moved PercentGood/PercentBad there too — they are duration-based); anything appended to // the enum later falls to the refusal (total default). Enum.GetValues().Count(a => AggregateFamilies.FamilyOf(a) is not null).ShouldBe(17); Enum.GetValues().Where(a => AggregateFamilies.FamilyOf(a) == AggregateFamily.TimeWeighted) .ShouldBe([HistoryAggregateType.Total, HistoryAggregateType.Interpolative, HistoryAggregateType.TimeAverage, HistoryAggregateType.PercentGood, HistoryAggregateType.PercentBad, HistoryAggregateType.TimeAverage2, HistoryAggregateType.Total2]); } }