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()); }
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"); }