public void test_LongSum_withPredicate_field() { FillMap <Header>(); var predicate = Predicates.IsGreaterThan("id", 5); Assert.AreEqual(30, map.Aggregate(Aggregators.LongSum("id"), predicate)); }
public void testAggregate_NullPredicate() { Assert.Throws <ArgumentException>(() => { map.Aggregate(Aggregators.LongSum("id"), null); }); }
public async Task Test_LongSum_field() { var dictionary = await Client.GetMapAsync <string, Header>(CreateUniqueName()); await using var _ = DestroyAndDispose(dictionary); await Fill(dictionary, i => new Header(i, new Handle(false))); Assert.AreEqual(45, await dictionary.AggregateAsync(Aggregators.LongSum("id"))); }
public async Task TestAggregate_NullPredicate() { var dictionary = await Client.GetMapAsync <string, int>(CreateUniqueName()); await using var _ = DestroyAndDispose(dictionary); await AssertEx.ThrowsAsync <ArgumentException>(async() => { await dictionary.AggregateAsync(Aggregators.LongSum("id"), null); }); }
public async Task Test_LongSum() { var dictionary = await Client.GetMapAsync <string, long>(CreateUniqueName()); await using var _ = DestroyAndDispose(dictionary); await Fill(dictionary, i => i); Assert.AreEqual(45, await dictionary.AggregateAsync(Aggregators.LongSum())); Assert.AreEqual(45, await dictionary.AggregateAsync(Aggregators.LongSum("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_LongSum_field() { FillMap <Header>(); Assert.AreEqual(45, map.Aggregate(Aggregators.LongSum("id"))); }
public void test_LongSum() { FillMap <long>(); Assert.AreEqual(45, map.Aggregate(Aggregators.LongSum())); Assert.AreEqual(45, map.Aggregate(Aggregators.LongSum("this"))); }
public void testAggregate_NullPredicate() { map.Aggregate(Aggregators.LongSum("id"), null); }