public static void CloneTest(IRandomSource source) { new Generator(source, "CloneTest").UInt64(); var clone = source.Clone(); Assert.IsNotNull(source); var sourceNext = new ValueUnion(); var cloneNext = new ValueUnion(); for (int i = 0; i < 100; i++) { source.Next(ref sourceNext); clone.Next(ref cloneNext); Assert.AreEqual(sourceNext.UInt64_0, cloneNext.UInt64_0); } }
/// <summary> /// Gets a copy of this <see cref="SynchronizedRandomSource"/> with the same state. /// </summary> public IRandomSource Clone() { return(source.Clone()); }