Ejemplo n.º 1
0
        public void description_from_a_func()
        {
            var match = new LastActionMatch(call => call.Method.Name.EndsWith("HTML"), "Action method is suffixed with HTML");

            var description = Description.For(match);

            description.ShortDescription.ShouldEqual("Action method is suffixed with HTML");
        }
Ejemplo n.º 2
0
        public void description_from_an_expression()
        {
            var match = new LastActionMatch(call => call.Method.Name.EndsWith("HTML"));

            var description = Description.For(match);

            description.ShortDescription.ShouldEqual("call => call.Method.Name.EndsWith(\"HTML\")");
        }
Ejemplo n.º 3
0
        public void matches_negative_with_one_action()
        {
            var chain = new BehaviorChain();

            chain.AddToEnd(ActionCall.For <ActionEndpoint>(x => x.get_hello()));

            var match = new LastActionMatch(call => call.Method.Name.EndsWith("HTML"));

            match.Matches(chain).ShouldBeFalse();
        }
Ejemplo n.º 4
0
        public void matches_positive_with_one_action()
        {
            var chain = new BehaviorChain();

            chain.AddToEnd(ActionCall.For <ActionEndpoint>(x => x.SaySomethingHTML()));

            var match = new LastActionMatch(call => call.Method.Name.EndsWith("HTML"));

            match.Matches(chain).ShouldBeTrue();
        }
Ejemplo n.º 5
0
        public void only_matches_the_last_action_call()
        {
            var chain = new BehaviorChain();

            chain.AddToEnd(ActionCall.For <ActionEndpoint>(x => x.SaySomethingHTML()));
            chain.AddToEnd(ActionCall.For <ActionEndpoint>(x => x.get_hello()));

            var match = new LastActionMatch(call => call.Method.Name.EndsWith("HTML"));

            match.Matches(chain).ShouldBeFalse();
        }
Ejemplo n.º 6
0
        public void does_not_blow_up_with_no_chains()
        {
            var match = new LastActionMatch(call => call.Method.Name.EndsWith("HTML"));

            match.Matches(new BehaviorChain()).ShouldBeFalse();
        }