Exemplo n.º 1
0
        public void should_log_when_default_route_found()
        {
            var call = new ActionCall(typeof(TestController), _method);

            _policy.Matches(call);

            call.As <ITracedModel>().StagedEvents.OfType <Traced>().Any().ShouldBeTrue();
        }
Exemplo n.º 2
0
        public void should_throw_if_more_than_one_call_has_the_same_input_type()
        {
            var firstMethod = ReflectionHelper.GetMethod <TestController>(c => c.SomeAction(null));
            var otherMethod = ReflectionHelper.GetMethod <TestController>(c => c.AnotherAction(null));
            var policy      = new DefaultRouteInputTypeBasedUrlPolicy(typeof(TestInputModel));

            var firstCall = new ActionCall(typeof(TestController), firstMethod);
            var otherCall = new ActionCall(typeof(TestController), otherMethod);

            policy.Matches(firstCall);

            typeof(FubuException).ShouldBeThrownBy(() => policy.Matches(otherCall));
        }
Exemplo n.º 3
0
        public void should_match_the_action_call_input_type()
        {
            var call = new ActionCall(typeof(TestController), _method);

            _policy.Matches(call, _log).ShouldBeTrue();
        }