Package br.com.six2six.fixturefactory.function.impl

Examples of br.com.six2six.fixturefactory.function.impl.RandomFunction.generateValue()


  public void randomLongDistributionTest() {
      Long start = 85L, end = 86L;
        RandomFunction randomFunction = new RandomFunction(Long.class, new Range(start, end));
        Set<Long> values = new HashSet<Long>();
        for (int i=0; i<10; i++) {
            values.add((Long) randomFunction.generateValue());
        }
        assertTrue("Generated at least one equal to start", values.contains(start));
        assertTrue("Generated at least one equal to end", values.contains(end));
  }
View Full Code Here


  public void randomDoubleRangeTest() {
      Double start = 85.1, end = 85.2;
      RandomFunction randomFunction = new RandomFunction(Double.class, new Range(start, end));
        for (int i=0; i<10; i++) {
            Object value = randomFunction.generateValue();
            assertNotNull("Generated double can not be null", value);
            assertTrue("Generated double does not exist in the range", (start <= (Double) value && (Double) value <= end));
        }
  }
View Full Code Here

  public void randomBigIntegerDistributionTest() {
      BigInteger start = new BigInteger("2147483648"), end = new BigInteger("2147483649");
      RandomFunction randomFunction = new RandomFunction(BigInteger.class, new Range(start, end));
      Set<BigInteger> values = new HashSet<BigInteger>();
      for (int i=0; i<10; i++) {
          values.add((BigInteger) randomFunction.generateValue());
      }
      assertTrue("Generated at least one equal to start", values.contains(start));
      assertTrue("Generated at least one equal to end", values.contains(end));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.