/// <summary> /// Checks declarative constraints, and then checks imperatively. /// </summary> public IConsent IsParameterSetValid(INakedObjectAdapter nakedObjectAdapter, INakedObjectAdapter[] parameterSet) { IInteractionContext ic; var buf = new InteractionBuffer(); if (parameterSet != null) { INakedObjectAdapter[] parms = RealParameters(nakedObjectAdapter, parameterSet); for (int i = 0; i < parms.Length; i++) { ic = InteractionContext.ModifyingPropParam(Session, false, RealTarget(nakedObjectAdapter), Identifier, parameterSet[i]); InteractionUtils.IsValid(GetParameter(i), ic, buf); } } INakedObjectAdapter target = RealTarget(nakedObjectAdapter); ic = InteractionContext.InvokingAction(Session, false, target, Identifier, parameterSet); InteractionUtils.IsValid(this, ic, buf); return(InteractionUtils.IsValid(buf)); }
public override IConsent IsUsable(INakedObjectAdapter target) { IInteractionContext ic = InteractionContext.InvokingAction(Session, false, RealTarget(target), Identifier, new[] { target }); return(InteractionUtils.IsUsable(this, ic)); }
public void IsNotProgramaticTest() { IInteractionContext context = InteractionContext.InvokingAction(null, null, false, null, null, null); Assert.IsFalse(context.IsProgrammatic); }
public void IsProgramaticTest() { IInteractionContext context = InteractionContext.InvokingAction(null, null, true, null, null, null); Assert.IsTrue(context.IsProgrammatic); }