示例#1
0
        public void can_store_small_sample()
        {
            _reservoir.Update(1L);
            _reservoir.Update(2L);

            _reservoir.GetSnapshot().Values.Should().ContainInOrder(1L, 2L);
        }
示例#2
0
        public void SlidingWindowReservoir_CanStoreSmallSample()
        {
            reservoir.Update(1L);
            reservoir.Update(2L);

            reservoir.GetSnapshot().Values.Should().ContainInOrder(1L, 2L);
        }
        public void SlidingWindowResevoir()
        {
            var reservoir = new SlidingWindowReservoir(Constants.ReservoirSampling.DefaultSampleSize);

            foreach (var sample in _samples)
            {
                reservoir.Update((long)sample);
            }

            var snapshot = reservoir.GetSnapshot();

            //TODO: Assert snapshot
            //snapshot.AssertValues(_samples);
        }