예제 #1
0
 public static string LinkVariable <TInput>(this IFubuPage page, string variable) where TInput : new()
 {
     return(page.LinkVariable(variable, new TInput()));
 }
예제 #2
0
 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();
 }
예제 #3
0
 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();
 }
예제 #4
0
 /// <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));
 }