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)); }
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); }
public static HtmlTag FormFor <TInputModel>(this IFubuPage page, TInputModel model) { return(page.FormFor(ChainSearch.ByUniqueInputType(model.GetType(), "POST"), model)); }
public static HtmlTag FormFor <TInputModel>(this IFubuPage page) where TInputModel : new() { var search = ChainSearch.ByUniqueInputType(typeof(TInputModel), "POST"); return(page.FormFor(search, new TInputModel())); }
public virtual HandlerChain FindChain(Envelope envelope) { var messageType = envelope.Message.GetType(); return(_chainResolver.Find(ChainSearch.ByUniqueInputType(messageType, required: false)).As <HandlerChain>()); }
public void default_search_is_required() { ChainSearch.ByUniqueInputType(typeof(ChainSearch)).Required.ShouldBeTrue(); }
public void search_can_be_optional() { ChainSearch.ByUniqueInputType(typeof(ChainSearch), required: false).Required.ShouldBeFalse(); }