public async Task Test_LongAvg() { var dictionary = await Client.GetMapAsync <string, int>(CreateUniqueName()); await using var _ = DestroyAndDispose(dictionary); await Fill(dictionary, i => i); Assert.AreEqual(4.5d, await dictionary.AggregateAsync(Aggregators.LongAvg())); Assert.AreEqual(4.5d, await dictionary.AggregateAsync(Aggregators.LongAvg("this"))); }
public void Tests() { AssertAggregator((CountAggregator)Aggregators.Count("name"), AggregatorDataSerializerHook.Count); AssertAggregator((BigIntegerSumAggregator)Aggregators.BigIntegerSum("name"), AggregatorDataSerializerHook.BigIntSum); AssertAggregator((DoubleSumAggregator)Aggregators.DoubleSum("name"), AggregatorDataSerializerHook.DoubleSum); AssertAggregator((FixedSumAggregator)Aggregators.FixedPointSum("name"), AggregatorDataSerializerHook.FixedSum); AssertAggregator((LongSumAggregator)Aggregators.LongSum("name"), AggregatorDataSerializerHook.LongSum); AssertAggregator((FloatingPointSumAggregator)Aggregators.FloatingPointSum("name"), AggregatorDataSerializerHook.FloatingPointSum); AssertAggregator((IntegerSumAggregator)Aggregators.IntegerSum("name"), AggregatorDataSerializerHook.IntSum); AssertAggregator((NumberAverageAggregator)Aggregators.NumberAvg("name"), AggregatorDataSerializerHook.NumberAvg); AssertAggregator((DoubleAverageAggregator)Aggregators.DoubleAvg("name"), AggregatorDataSerializerHook.DoubleAvg); AssertAggregator((IntegerAverageAggregator)Aggregators.IntegerAvg("name"), AggregatorDataSerializerHook.IntAvg); AssertAggregator((LongAverageAggregator)Aggregators.LongAvg("name"), AggregatorDataSerializerHook.LongAvg); AssertAggregator((MaxAggregator <int>)Aggregators.Max <int>("name"), AggregatorDataSerializerHook.Max); AssertAggregator((MinAggregator <int>)Aggregators.Min <int>("name"), AggregatorDataSerializerHook.Min); AssertAggregator((CountAggregator)Aggregators.Count(), AggregatorDataSerializerHook.Count); AssertAggregator((BigIntegerSumAggregator)Aggregators.BigIntegerSum(), AggregatorDataSerializerHook.BigIntSum); AssertAggregator((DoubleSumAggregator)Aggregators.DoubleSum(), AggregatorDataSerializerHook.DoubleSum); AssertAggregator((FixedSumAggregator)Aggregators.FixedPointSum(), AggregatorDataSerializerHook.FixedSum); AssertAggregator((LongSumAggregator)Aggregators.LongSum(), AggregatorDataSerializerHook.LongSum); AssertAggregator((FloatingPointSumAggregator)Aggregators.FloatingPointSum(), AggregatorDataSerializerHook.FloatingPointSum); AssertAggregator((IntegerSumAggregator)Aggregators.IntegerSum(), AggregatorDataSerializerHook.IntSum); AssertAggregator((NumberAverageAggregator)Aggregators.NumberAvg(), AggregatorDataSerializerHook.NumberAvg); AssertAggregator((DoubleAverageAggregator)Aggregators.DoubleAvg(), AggregatorDataSerializerHook.DoubleAvg); AssertAggregator((IntegerAverageAggregator)Aggregators.IntegerAvg(), AggregatorDataSerializerHook.IntAvg); AssertAggregator((LongAverageAggregator)Aggregators.LongAvg(), AggregatorDataSerializerHook.LongAvg); AssertAggregator((MaxAggregator <int>)Aggregators.Max <int>(), AggregatorDataSerializerHook.Max); AssertAggregator((MinAggregator <int>)Aggregators.Min <int>(), AggregatorDataSerializerHook.Min); }
public void test_LongAvg() { FillMap <long>(); Assert.AreEqual(4.5d, map.Aggregate(Aggregators.LongAvg())); Assert.AreEqual(4.5d, map.Aggregate(Aggregators.LongAvg("this"))); }