public void MaxAggregator_Merge() { var maxAggr1 = new MaxAggregator("test"); var maxAggr2 = new MaxAggregator("test"); Func <object, string, object> getVal = (r, f) => { return(r); }; maxAggr1.Push(5, getVal); maxAggr1.Push(2, getVal); maxAggr2.Push(3, getVal); maxAggr1.Merge(maxAggr2); Assert.Equal(5, maxAggr1.Value); maxAggr2.Merge(maxAggr1); Assert.Equal(5, maxAggr2.Value); // datetime values var maxAggr3 = new MaxAggregator("test"); maxAggr3.Push(new DateTime(1983, 5, 6), getVal); maxAggr3.Push(new DateTime(2000, 1, 1), getVal); Assert.Equal(2000, ((DateTime)maxAggr3.Value).Year); var maxAggr4 = new MaxAggregator("test"); maxAggr4.Push(new DateTime(2010, 2, 2), getVal); maxAggr3.Merge(maxAggr4); Assert.Equal(2010, ((DateTime)maxAggr3.Value).Year); }
public void MaxAggregator() { var maxAggr = new MaxAggregator("test"); Func <object, string, object> getVal = (r, f) => { Assert.Equal("test", f); return(r); }; maxAggr.Push(5, getVal); Assert.Equal(5, maxAggr.Value); maxAggr.Push(3, getVal); Assert.Equal(5, maxAggr.Value); maxAggr.Push(7, getVal); Assert.Equal(7, maxAggr.Value); }
public VolumeMeter(ProgressBar progressBar) { this.progressBar = progressBar; this.aggregator = new MaxAggregator(1000, SetVolumeMeter); }
protected override void InitializeSystemUnderTests() { SystemUnderTests = new MaxAggregator(); }
public Normalize() { this.aggregator = new MaxAggregator(1000, SetVolumeMeter); }