public static string LinkVariable <TInput>(this IFubuPage page, string variable) where TInput : new() { return(page.LinkVariable(variable, new TInput())); }
public void should_return_formatted_link_variable() { _page.LinkVariable("variable", _model).ShouldEqual("var {0} = '{1}';".ToFormat("variable", "url for FubuMVC.Tests.UI.InputModel, category GET")); _page.VerifyAllExpectations(); }
public void should_return_formatted_link_variable() { _page.LinkVariable("variable", _model).ShouldEqual("var {0} = '{1}';".ToFormat("variable", "some url")); _urls.AssertWasCalled(u => u.UrlFor(_model)); _page.VerifyAllExpectations(); }
/// <summary> /// Creates a json variable to the url for the input type T /// var [variable] = '[IUrlRegistry.UrlFor<T>()]' /// </summary> /// <typeparam name="TInput"></typeparam> /// <param name="page"></param> /// <param name="variable"></param> /// <returns></returns> public static string LinkVariable <TInput>(this IFubuPage page, string variable, string categoryOrHttpMethod = "GET") where TInput : new() { return(page.LinkVariable(variable, new TInput(), categoryOrHttpMethod)); }