< Summary

Information
Class: MyNet.Generator.SystemRandomSource
Assembly: MyNet.Generator
File(s): https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Generator/SystemRandomSource.cs
Tag: 323_28699572109
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 26
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
NextInt32(...)100%11100%
NextDouble()100%11100%
NextBytes(...)100%11100%

File(s)

https://raw.githubusercontent.com/sandre58/MyNet/85372080fe102cd9ee155ceab49ae000e7f66103/src/MyNet.Generator/SystemRandomSource.cs

#LineLine coverage
 1// -----------------------------------------------------------------------
 2// <copyright file="SystemRandomSource.cs" company="Stéphane ANDRE">
 3// Copyright (c) Stéphane ANDRE. All rights reserved.
 4// </copyright>
 5// -----------------------------------------------------------------------
 6
 7using System.Diagnostics.CodeAnalysis;
 8
 9namespace MyNet.Generator;
 10
 11/// <summary>
 12/// Current random source backed by <see cref="System.Random.Shared"/>.
 13/// </summary>
 14[SuppressMessage("Security", "CA5394:Do not use insecure randomness", Justification = "Using System.Random.Shared for no
 15public sealed class SystemRandomSource : IRandomSource
 16{
 17    /// <inheritdoc />
 443418    public int NextInt32(int minInclusive, int maxExclusive) => System.Random.Shared.Next(minInclusive, maxExclusive);
 19
 20    /// <inheritdoc />
 399621    public double NextDouble() => System.Random.Shared.NextDouble();
 22
 23    /// <inheritdoc />
 624    public void NextBytes(byte[] buffer) => System.Random.Shared.NextBytes(buffer);
 25}
 26