protected override void doSpecificCheck(RenderJsonNode node, BehaviorSpecCheck check) { if (_modelType == node.ModelType) { check.RegisterError("Wrong model type. Should be {0} but was {1}".ToFormat(_modelType.FullName, node.ModelType.FullName)); } }
public void Verify(BehaviorChain chain) { var check = new BehaviorSpecCheck(); Verify(check, chain.Top); check.AssertBehaviors(); }
protected void propagate(BehaviorSpecCheck check, IBehaviorSpec spec, BehaviorNode node) { if (spec == null && node != null) { check.RegisterError("unexpected node: " + node); } if (spec != null) { spec.Verify(check, node); } }
protected override void doSpecificCheck(ActionCall call, BehaviorSpecCheck check) { if (call.HandlerType != _type) { check.RegisterError("type was " + call.HandlerType.Name); } if (call.Method != _method) { check.RegisterError("method was " + call.Method.Name); } }
protected override void doSpecificCheck(ConnegOutputNode node, BehaviorSpecCheck check) { if (_modelType == node.InputType) { check.RegisterError("Wrong model type. Should be {0} but was {1}".ToFormat(_modelType.FullName, node.InputType.FullName)); } if (typeof(JsonFormatter) != node.SelectedFormatterTypes.SingleOrDefault()) { check.RegisterError("Not a json output conneg node"); } }
public void Verify(BehaviorSpecCheck check, BehaviorNode node) { check.Write(ToString()); if (node == null) { check.RegisterError("was null"); return; } var specific = node as T; if (specific == null) { check.RegisterError("was " + node.GetType().Name); return; } specificChecks(specific, check); }
protected abstract void doSpecificCheck(T node, BehaviorSpecCheck check);
protected override void specificChecks(T node, BehaviorSpecCheck check) { doSpecificCheck(node, check); propagate(check, Inner, node.Next); }
protected abstract void specificChecks(T call, BehaviorSpecCheck check);