private static void PrepareRng(int queueCount, int rngValue) { Mock <IRandomSource> mockRng = new Mock <IRandomSource>(); mockRng .Setup(rng => rng.Next(It.IsAny <int>())) .Returns( (int size) => { Assert.Equal(queueCount, size); return(rngValue); } ); RandomSources.SetRng(mockRng.Object); }
public void Dispose() => RandomSources.SetRng(null);