Class DefaultSingleConstraintVerification<Solution_,Score_ extends Score<Score_>>
java.lang.Object
ai.timefold.solver.test.impl.score.stream.DefaultSingleConstraintVerification<Solution_,Score_>
- All Implemented Interfaces:
SingleConstraintVerification<Solution_>
public final class DefaultSingleConstraintVerification<Solution_,Score_ extends Score<Score_>>
extends Object
implements SingleConstraintVerification<Solution_>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.Loggerprotected final AbstractConstraintStreamScoreDirectorFactory<Solution_,Score_, ?> protected final ai.timefold.solver.test.impl.score.stream.SessionBasedAssertionBuilder<Solution_,Score_> -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertCorrectArguments(Object... facts) @NonNull DefaultSingleConstraintAssertion<Solution_,Score_> If the code under test usesPlanningListVariable, the facts provided to this method need to meet either one of the following criteria: It needs to include both the planning entity and the planning value(s), and the planning entity needs to have its list variable correctly filled. The planning values need to have theirInverseRelationShadowVariableset to the entity with the relevant list variable. In case none of these are met, the values will be reported as unassigned and therefore will be filtered out by theConstraintFactory.forEach(Class)check.givenSolution(@NonNull Solution_ solution)
-
Field Details
-
LOGGER
protected final org.slf4j.Logger LOGGER -
scoreDirectorFactory
protected final AbstractConstraintStreamScoreDirectorFactory<Solution_,Score_ extends Score<Score_>, scoreDirectorFactory?> -
sessionBasedAssertionBuilder
-
-
Method Details
-
given
public @NonNull DefaultSingleConstraintAssertion<Solution_,Score_> given(@NonNull Object @NonNull ... facts) Description copied from interface:SingleConstraintVerificationIf the code under test usesPlanningListVariable, the facts provided to this method need to meet either one of the following criteria:- It needs to include both the planning entity and the planning value(s), and the planning entity needs to have its list variable correctly filled.
- The planning values need to have their
InverseRelationShadowVariableset to the entity with the relevant list variable.
ConstraintFactory.forEach(Class)check.ConstraintFactory.forEachIncludingUnassigned(Class)will include them regardless.- Specified by:
givenin interfaceSingleConstraintVerification<Solution_>- Parameters:
facts- at least one
-
givenSolution
public @NonNull DefaultShadowVariableAwareSingleConstraintAssertion<Solution_,Score_> givenSolution(@NonNull Solution_ solution) - Specified by:
givenSolutionin interfaceSingleConstraintVerification<Solution_>
-
assertCorrectArguments
-