Пример #1
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));
        }
Пример #2
0
 public void SetUp()
 {
     _method = ReflectionHelper.GetMethod <TestController>(c => c.SomeAction(null));
     _policy = new DefaultRouteInputTypeBasedUrlPolicy(typeof(TestInputModel));
 }