Пример #1
0
    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);
    }
Пример #2
0
 public void Dispose() => RandomSources.SetRng(null);