Ejemplo n.º 1
0
        public void TakesFirstMSamples()
        {
            var sut          = new ReservoirSampling();
            var sampleSource = new SampleSource(2);

            var sample = sut.GetReservoirSample(sampleSource, 2);

            Assert.True(sample.All(arg => arg > 0));
        }
Ejemplo n.º 2
0
        public void TakesSamplesFromStream()
        {
            var sut          = new ReservoirSampling();
            var sampleSource = new SampleSource(1000);

            var sample = sut.GetReservoirSample(sampleSource, 10);

            Assert.True(sample.All(arg => arg > 0));
        }