public void TestInteropSeed()
 {
     // use the same seed as in Java
     const int seed = 1234567890;
     var random = new InteropRandom(seed);
     var result1 = random.NextInt(1000);
     var result2 = random.NextInt(500);
     var result3 = random.NextInt(10);
   
     // requires same results as in Java
     // result1 is 677
     // result2 is 242
     // result3 is 1
     Assert.AreEqual(result1, 677);
     Assert.AreEqual(result2, 242);
     Assert.AreEqual(result3, 1);
 }
Beispiel #2
0
 private static Number160 CreateRandomId(InteropRandom rnd)
 {
     var vals = new int[Number160.IntArraySize];
     for (int i = 0; i < vals.Length; i++)
     {
         vals[i] = rnd.NextInt(Int32.MaxValue);
     }
     return new Number160(vals);
 }