Пример #1
0
        public static HtmlTag FormFor(this IFubuPage view, object input)
        {
            if (input is string)
            {
                return(view.FormFor(input.As <string>()));
            }

            var search = ChainSearch.ByUniqueInputType(input.GetType(), "POST");

            return(view.FormFor(search, input));
        }
Пример #2
0
        public void SetUp()
        {
            theServices = new InMemoryServiceLocator();
            theSearch   = ChainSearch.ByUniqueInputType(typeof(object));
            theInput    = new object();

            theResolver    = MockRepository.GenerateStub <IChainResolver>();
            theUrlResolver = MockRepository.GenerateStub <IChainUrlResolver>();

            theChain = new RoutedChain("something");

            theServices.Add(theResolver);
            theServices.Add(theUrlResolver);

            theRequest = new FormRequest(theSearch, theInput);
        }
Пример #3
0
 public static HtmlTag FormFor <TInputModel>(this IFubuPage page, TInputModel model)
 {
     return(page.FormFor(ChainSearch.ByUniqueInputType(model.GetType(), "POST"), model));
 }
Пример #4
0
        public static HtmlTag FormFor <TInputModel>(this IFubuPage page) where TInputModel : new()
        {
            var search = ChainSearch.ByUniqueInputType(typeof(TInputModel), "POST");

            return(page.FormFor(search, new TInputModel()));
        }
Пример #5
0
        public virtual HandlerChain FindChain(Envelope envelope)
        {
            var messageType = envelope.Message.GetType();

            return(_chainResolver.Find(ChainSearch.ByUniqueInputType(messageType, required: false)).As <HandlerChain>());
        }
Пример #6
0
 public void default_search_is_required()
 {
     ChainSearch.ByUniqueInputType(typeof(ChainSearch)).Required.ShouldBeTrue();
 }
Пример #7
0
 public void search_can_be_optional()
 {
     ChainSearch.ByUniqueInputType(typeof(ChainSearch), required: false).Required.ShouldBeFalse();
 }