コード例 #1
0
        public void Reset()
        {
            var generator = new PrecomputedSamplesGenerator(new double[] { 0, 1, 2, 3 });

            Assert.AreEqual(0, generator.Next());

            generator.Reset();
            Assert.AreEqual(0, generator.Next());
        }
コード例 #2
0
        public void Loops()
        {
            var generator = new PrecomputedSamplesGenerator(new double[] { 0, 1, 2, 3 });

            Assert.AreEqual(0, generator.Next());
            Assert.AreEqual(1, generator.Next());
            Assert.AreEqual(2, generator.Next());
            Assert.AreEqual(3, generator.Next());

            Assert.AreEqual(0, generator.Next(), "Must loop over input array");
            Assert.AreEqual(1, generator.Next(), "Must loop over input array");
            Assert.AreEqual(2, generator.Next(), "Must loop over input array");
            Assert.AreEqual(3, generator.Next(), "Must loop over input array");

            Assert.AreEqual(0, generator.Next(), "Must loop over input array");
        }