private ActionResult CreateActionResultFromRegistry(ActionResultSelector selector)
        {
            var registryItem = actionResultRegistry.Create(selector);
            var resultFactory = registryItem.Create<IActionResultFactory>(objectFactory);

            return resultFactory.Create(selector);
        }
 public override void Given()
 {
     Selector = CreateStub<ActionResultSelector>();
     actionResultResolver = new FluentMvcResolver(actionResultRegistry, CreateStub<IFluentMvcObjectFactory>(), new ActionFilterResolver(actionFilterRegistry, CreateStub<IFluentMvcObjectFactory>()));
     CatchAllFactory = CreateStub<IActionResultFactory>();
     actionResultResolver.SetDefaultFactory(CatchAllFactory);
 }
Esempio n. 3
0
        private ActionResult CreateActionResultFromRegistry(ActionResultSelector selector)
        {
            var registryItem  = actionResultRegistry.Create(selector);
            var resultFactory = registryItem.Create <IActionResultFactory>(objectFactory);

            return(resultFactory.Create(selector));
        }
        public ActionResult CreateActionResult(ActionResultSelector selector)
        {
            if (actionResultRegistry.CanSatisfy(selector))
            {
                return CreateActionResultFromRegistry(selector);
            }

            return ActionResultPipeLine.Create(selector) ?? DefaultFactory.Create(selector);
        }
Esempio n. 5
0
        public ActionResult CreateActionResult(ActionResultSelector selector)
        {
            if (actionResultRegistry.CanSatisfy(selector))
            {
                return(CreateActionResultFromRegistry(selector));
            }

            return(ActionResultPipeLine.Create(selector) ?? DefaultFactory.Create(selector));
        }
        public override void Given()
        {
            pipeline = CreateStub<IActionResultPipeline>();

            ExpectedActionResult = CreateStub<ActionResult>();
            pipeline.Stub(factory => factory.Create(Arg<ActionResultSelector>.Is.Anything))
                .Return(ExpectedActionResult);

            FactoryOptions = CreateStub<ActionResultSelector>();
            actionResultResolver = new FluentMvcResolver(actionResultRegistry, CreateStub<IFluentMvcObjectFactory>(), new ActionFilterResolver(actionFilterRegistry, CreateStub<IFluentMvcObjectFactory>()));
            actionResultResolver.RegisterActionResultPipeline(pipeline);
        }
Esempio n. 7
0
 protected override ActionResult CreateCore(ActionResultSelector selector)
 {
     throw new Exception("ErrorThrowingResultFactory");
 }
Esempio n. 8
0
 public ActionResult CreateActionResult(ActionResultSelector selector)
 {
     return actionResultResolver.CreateActionResult(selector);
 }
Esempio n. 9
0
 public ActionResult CreateActionResult(ActionResultSelector selector)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 10
0
 public ActionResult CreateActionResult(ActionResultSelector selector)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 11
0
 public ActionResult CreateActionResult(ActionResultSelector selector)
 {
     return(actionResultResolver.CreateActionResult(selector));
 }
 public bool ShouldBeReturnedFor(ActionResultSelector selector)
 {
     return selector.AcceptTypes.Contains("accept");
 }
 public ActionResult Create(ActionResultSelector selector)
 {
     return new TestActionResult();
 }