@Override public ObjectSpecification specFor(final ObjectMember objectMember) { return objectMember.getSpecification(); } },
@Override public ObjectSpecification specFor(final ObjectMember objectMember) { return objectMember.getSpecification(); } },
@Override public ObjectSpecification specFor(final ObjectMember objectMember) { return objectMember.getSpecification(); } },
@Override public ObjectSpecification specFor(final ObjectMember objectMember) { return objectMember.getSpecification(); } },
@Override public ObjectSpecification specFor(final ObjectMember objectMember) { return objectMember.getSpecification(); } },
@Override public ObjectSpecification specFor(final ObjectMember objectMember) { return objectMember.getSpecification(); } },
protected <F extends Facet> F getMemberSpecFacet(final Class<F> facetType) { final ObjectSpecification otoaSpec = objectMember.getSpecification(); return otoaSpec.getFacet(facetType); }
/** * Convenience method. */ protected <F extends Facet> F getMemberSpecFacet(final Class<F> facetType) { final ObjectSpecification objetMemberSpec = objectMember.getSpecification(); return objetMemberSpec.getFacet(facetType); }
protected <F extends Facet> F getMemberSpecFacet(final Class<F> facetType) { final ObjectSpecification otoaSpec = objectMember.getSpecification(); return otoaSpec.getFacet(facetType); }
@Override protected void doThat(final PerformContext performContext, final Iterable<ObjectAdapter> collection) throws ScenarioBoundValueException { final ObjectMember nakedObjectMember = performContext.getObjectMember(); final CellBinding thatBinding = performContext.getPeer().getThatItBinding(); final CellBinding arg0Binding = performContext.getPeer().getArg0Binding(); if (!arg0Binding.isFound()) { throw ScenarioBoundValueException.current(thatBinding, "(requires argument)"); } final ScenarioCell arg0Cell = arg0Binding.getCurrentCell(); final ObjectAdapter containedAdapter = performContext.getPeer().getAdapter(null, nakedObjectMember.getSpecification(), arg0Binding, arg0Cell); boolean contains = false; for (final ObjectAdapter eachAdapter : collection) { if (containedAdapter == eachAdapter) { contains = true; break; } } if (!assertion.isSatisfiedBy(contains)) { throw ScenarioBoundValueException.current(arg0Binding, assertion.getErrorMsgIfNotSatisfied()); } }
@Override public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException { final ObjectMember nakedObjectMember = performContext.getObjectMember(); final CellBinding thatBinding = performContext.getPeer().getThatItBinding(); final CellBinding arg0Binding = performContext.getPeer().getArg0Binding(); // check we have an argument to validate (if one is required) if (!arg0Binding.isFound()) { throw ScenarioBoundValueException.current(thatBinding, "(requires argument)"); } final ScenarioCell arg0Cell = arg0Binding.getCurrentCell(); final String toValidate = arg0Cell.getText(); if (StringUtils.isNullOrEmpty(toValidate)) { throw ScenarioBoundValueException.current(arg0Binding, "(required)"); } final ObjectAdapter toValidateAdapter = performContext.getPeer().getAdapter(null, nakedObjectMember.getSpecification(), arg0Binding, arg0Cell); final Consent validityConsent = determineConsent(performContext, toValidateAdapter); if (!getAssertion().satisfiedBy(validityConsent)) { throw ScenarioBoundValueException.current(getAssertion().colorBinding(arg0Binding, thatBinding), getAssertion().getReason(validityConsent)); } return toValidateAdapter; }