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

Examples of br.com.six2six.fixturefactory.function.impl.RandomFunction


   
    @Test
    public void shouldGenerateAValue() {
        Long start = 1L;
        Long end = 10L;
        Property property = new Property("someNumber", new RandomFunction(Long.class, new Range(start, end)));
        Long value = (Long) property.getValue()
        assertTrue(start <= value && value <= end);
    }
View Full Code Here


  public AssociationFunction one(Class<?> clazz, String label) {
    return new AssociationFunctionImpl(clazz, label);
  }
 
  public Function random(Class<?> clazz, Object... dataset) {
    return new RandomFunction(clazz, dataset);
  }
View Full Code Here

  public Function random(Class<?> clazz, Object... dataset) {
    return new RandomFunction(clazz, dataset);
  }

  public Function random(Class<? extends BigDecimal> clazz, MathContext mc) {
      return new RandomFunction(clazz, mc);
  }
View Full Code Here

  public Function random(Class<? extends BigDecimal> clazz, MathContext mc) {
      return new RandomFunction(clazz, mc);
  }

  public Function random(Object... dataset) {
    return new RandomFunction(dataset);
  }
View Full Code Here

  public Function random(Object... dataset) {
    return new RandomFunction(dataset);
  }
 
  public Function random(Class<?> clazz, Range range) {
    return new RandomFunction(clazz, range);
  }
View Full Code Here

public class RandomFunctionTest {

    @Test
    public void randomByteTest() {
        Object value = new RandomFunction(Byte.class).generateValue();
        assertNotNull("Generated byte must not be null", value);
        assertTrue("Generated value is not a byte", value instanceof Byte);
    }
View Full Code Here

        assertTrue("Generated value is not a byte", value instanceof Byte);
    }
   
    @Test
    public void randomShortTest() {
        Object value = new RandomFunction(Short.class).generateValue();
        assertNotNull("Generated short must  not be null", value);
        assertTrue("Generated value is not a short", value instanceof Short);
    }
View Full Code Here

        assertTrue("Generated value is not a short", value instanceof Short);
    }

  @Test
  public void randomIntegerTest() {
    Object value = new RandomFunction(Integer.class).generateValue();
    assertNotNull("Generated integer can not be null", value);
    assertTrue("Generated value is not a Integer", value instanceof Integer);
  }
View Full Code Here

    assertTrue("Generated value is not a Integer", value instanceof Integer);
  }

    @Test
    public void randomLongTest() {
        Object value = new RandomFunction(Long.class).generateValue();
        assertNotNull("Generated long can not be null", value);
        assertTrue("Generated value is not a Long", value instanceof Long);
    }
View Full Code Here

        assertTrue("Generated value is not a Long", value instanceof Long);
    }
   
  @Test
  public void randomFloatTest() {
    Object value = new RandomFunction(Float.class).generateValue();
    assertNotNull("Generated float can not be null", value);
    assertTrue("Generated value is not a Float", value instanceof Float);
  }
View Full Code Here

TOP

Related Classes of br.com.six2six.fixturefactory.function.impl.RandomFunction

Copyright © 2018 www.massapicom. 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.