Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public static HtmlTag FormFor <TInputModel>(this IFubuPage page, TInputModel model)
 {
     return(page.FormFor(ChainSearch.ByUniqueInputType(model.GetType(), "POST"), model));
 }
Exemplo n.º 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()));
        }
Exemplo n.º 5
0
        public virtual HandlerChain FindChain(Envelope envelope)
        {
            var messageType = envelope.Message.GetType();

            return(_chainResolver.Find(ChainSearch.ByUniqueInputType(messageType, required: false)).As <HandlerChain>());
        }
Exemplo n.º 6
0
 public void default_search_is_required()
 {
     ChainSearch.ByUniqueInputType(typeof(ChainSearch)).Required.ShouldBeTrue();
 }
Exemplo n.º 7
0
 public void search_can_be_optional()
 {
     ChainSearch.ByUniqueInputType(typeof(ChainSearch), required: false).Required.ShouldBeFalse();
 }