Repository navigation
Generate Random Numbers: .NET 10, range fixes and tests that can fail - #2313
Merged
vladimir-pecanac-main merged 3 commits intoOct 21, 2026
Conversation
Retarget both projects to net10.0 with MSTest 4.5.1, Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0. Remove the discarded RandomNumberGenerator.Create() calls and the getSecureDouble() helper, use Random.Shared, add the inclusive-bound and long-range helpers the article shows, fix the empty-input crash in the Run Again prompt, and replace the seven IsNotNull tests with eleven tests that pin every bound.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retargets numbers-csharp/GenerateRandomNumbers to net10.0 with MSTest 4.5.1, removes the RandomNumberGenerator.Create() calls whose result was thrown away and the getSecureDouble() helper that did not return a double in a range, switches the unseeded helpers to Random.Shared, adds the inclusive-bound helper (NextInt64 with a widened upper bound, safe at int.MaxValue) and the long-range helper the article shows, fixes the Run Again prompt so an empty answer no longer throws, and replaces the seven IsNotNull tests, which could not fail, with eleven tests that pin each bound the article states.