Exemplo n.º 1
0
 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));
     }
 }
Exemplo n.º 2
0
        public void Verify(BehaviorChain chain)
        {
            var check = new BehaviorSpecCheck();

            Verify(check, chain.Top);


            check.AssertBehaviors();
        }
Exemplo n.º 3
0
        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);
            }
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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");
            }
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
 protected abstract void doSpecificCheck(T node, BehaviorSpecCheck check);
Exemplo n.º 8
0
 protected override void specificChecks(T node, BehaviorSpecCheck check)
 {
     doSpecificCheck(node, check);
     propagate(check, Inner, node.Next);
 }
Exemplo n.º 9
0
 protected abstract void specificChecks(T call, BehaviorSpecCheck check);