Extended test to check NextNumber
This commit is contained in:
parent
e667d93a25
commit
d2b03df45c
@ -292,6 +292,22 @@ namespace FastRngTests.Double
|
||||
|
||||
Assert.That(masterToken.IsCancellationRequested, Is.False, "Master token was used to stop test");
|
||||
Assert.That(wasCanceled, Is.True, "The consumer was not canceled");
|
||||
|
||||
var tokenSource2 = new CancellationTokenSource(TimeSpan.FromSeconds(3));
|
||||
await rng.NextNumber(new Normal(), tokenSource2.Token);
|
||||
Assert.That(tokenSource2.IsCancellationRequested, Is.True);
|
||||
|
||||
tokenSource2 = new CancellationTokenSource(TimeSpan.FromSeconds(3));
|
||||
await rng.NextNumber(-1d, 1d, new Normal(), tokenSource2.Token);
|
||||
Assert.That(tokenSource2.IsCancellationRequested, Is.True);
|
||||
|
||||
tokenSource2 = new CancellationTokenSource(TimeSpan.FromSeconds(3));
|
||||
await rng.NextNumber(0u, 6u, new Normal(), tokenSource2.Token);
|
||||
Assert.That(tokenSource2.IsCancellationRequested, Is.True);
|
||||
|
||||
tokenSource2 = new CancellationTokenSource(TimeSpan.FromSeconds(3));
|
||||
await rng.NextNumber(0ul, 6ul, new Normal(), tokenSource2.Token);
|
||||
Assert.That(tokenSource2.IsCancellationRequested, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
Loading…
Reference in New Issue
Block a user