Unique number in random?
<p>I know there are many questions on the net about it ,but I would like to know why my method fails
What Am i Doing wrong?</p>

<pre><code>public class Generator
{

    private static readonly Random random = new Random();

    private static readonly object SyncLock = new object();

    public static int GetRandomNumber(int min, int max)
    {
        lock (SyncLock)
        { 
            return random.Next(min, max);
        }
    }

}


[TestFixture]
public class Class1
{
    [Test]
    public void SimpleTest()
    {

        var numbers=new List&lt;int&gt;();
        for (int i = 1; i &lt; 10000; i++)
        {
            var random = Generator.GetRandomNumber(1,10000);
            numbers.Add(random);
        }

        CollectionAssert.AllItemsAreUnique(numbers);

    }
}
</code></pre>

<p>EDIT
Test method is failing!! Sorry for not mentioning</p>

<p>Thanks for your time and suggestions</p>
