示例#1
0
 /** Test of getSeed method, of class Seed. */
 @Test
 public void testGetSeed() {
   System.out.println("getSeed");
   Seed instance = new Seed();
   Seed backup = new Seed(instance);
   assertArrayEquals(instance.getSeed(), backup.getSeed());
 }
示例#2
0
 @Test
 public void testBase64Strings() {
   try {
     Seed instance = new Seed();
     String s = instance.toString();
     Seed second = new Seed(s);
     int d1 = instance.decide(2);
     int d2 = second.decide(2);
     assertEquals(d1, d2);
   } catch (Exception ex) {
     Logger.getLogger(SeedTest.class.getName()).log(Level.SEVERE, null, ex);
   }
 }
示例#3
0
 /** Test of decide method, of class Seed. */
 @Test
 public void testDecide() {
   System.out.println("decide");
   int numberDecissions = 0;
   Seed instance = new Seed();
   Seed backup = new Seed(instance);
   assertArrayEquals(instance.getSeed(), backup.getSeed());
   int d1 = instance.decide(30);
   int d2 = backup.decide(30);
   assertEquals(d1, d2);
 }
示例#4
0
 @Test
 public void testHash() {
   try {
     Seed instance = new Seed();
     Seed second = new Seed(instance);
     byte[] h1 = instance.hash(second.getSeed());
     byte[] h2 = second.hash(instance.getSeed());
     assertArrayEquals(h1, h2);
   } catch (NoSuchAlgorithmException ex) {
     Logger.getLogger(SeedTest.class.getName()).log(Level.SEVERE, null, ex);
   }
 }