Package com.pholser.junit.quickcheck.internal.constraint

Examples of com.pholser.junit.quickcheck.internal.constraint.ConstraintEvaluator


    @Rule public final ExpectedException thrown = none();

    private ConstraintEvaluator evaluator;

    @Before public void beforeEach() {
        evaluator = new ConstraintEvaluator("#_ > 0");
    }
View Full Code Here


    @Test public void whenExpressionIsMalformed() {
        thrown.expect(EvaluationException.class);
        thrown.expectMessage("Malformed");

        evaluator = new ConstraintEvaluator("#_ !*@&#^*");
    }
View Full Code Here

        evaluator = new ConstraintEvaluator("#_ !*@&#^*");
    }

    @Test public void whenExpressionCannotBeEvaluatedCorrectly() {
        evaluator = new ConstraintEvaluator("#_.foo == 'bar'");
        evaluator.bind(4);

        thrown.expect(EvaluationException.class);
        thrown.expectCause(isA(NoSuchPropertyException.class));

View Full Code Here

        evaluator.evaluate();
    }

    @Test public void whenExpressionContainsAnUndefinedVariable() {
        evaluator = new ConstraintEvaluator("#x == -3");
        evaluator.bind(-3);

        thrown.expect(EvaluationException.class);
        thrown.expectMessage("Referring to undefined variable");
View Full Code Here

    private int discards;

    public GenerationContext(ParameterContext parameter, GeneratorRepository repository) {
        this.parameter = parameter;
        this.repository = repository;
        this.evaluator = new ConstraintEvaluator(parameter.constraint());
    }
View Full Code Here

TOP

Related Classes of com.pholser.junit.quickcheck.internal.constraint.ConstraintEvaluator

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.