Beispiel #1
0
        public void should_be_able_to_generate_url_from_named_route()
        {
            RouteTable.Routes.Clear();
            RouteTable.Routes.MapRoute(
                "namedRoute",
                "{controller}/{action}/{id}",
                new { controller = "Funky", Action = "Index", id = "" });

            OutBoundUrl.OfRouteNamed("namedRoute").ShouldMapToUrl("/");
        }
Beispiel #2
0
 public void should_be_able_to_generate_url_with_nullable_int_action_parameter()
 {
     OutBoundUrl.Of <FunkyController>(c => c.Nullable(24)).ShouldMapToUrl("/funky/nullable/24");
 }
Beispiel #3
0
 public void should_be_able_to_generate_url_from_controller_action_with_parameter()
 {
     OutBoundUrl.Of <FunkyController>(x => x.Foo(1)).ShouldMapToUrl("/Funky/Foo/1");
 }
Beispiel #4
0
 public void should_be_able_to_generate_url_from_controller_action()
 {
     OutBoundUrl.Of <FunkyController>(x => x.New()).ShouldMapToUrl("/Funky/New");
 }
Beispiel #5
0
 public void should_be_able_to_generate_url_from_controller_action_where_action_is_default()
 {
     OutBoundUrl.Of <FunkyController>(x => x.Index()).ShouldMapToUrl("/");
 }
Beispiel #6
0
 public void should_be_able_to_generate_url_with_optional_string_action_parameter_with_null()
 {
     OutBoundUrl.Of <OptionalExampleController>(c => c.String(null))
     .ShouldMapToUrl("/optional/string");
 }
Beispiel #7
0
 public void should_be_able_to_generate_url_with_optional_nullable_int_action_parameter_with_null()
 {
     OutBoundUrl.Of <OptionalExampleController>(c => c.NullableInt(null))
     .ShouldMapToUrl("/optional/nullableint");
 }