Unity provide UnityEngine.Random to access 'random' capabilities, but it's not easy to test it because of its interface. This post describes how to deal with it.
In Unity, UnityEngine.Random is to deal with random capabilities that can be used as below:
cs
using System;
UnityEngine.Random.value
It looks simple, however, as UnityEngine.Random.value is a shared value in the global scope, it's nearly impossible to test codes that are using Unity