public void route_invoke_using_static_method() { var route = new Route(typeof(RouteTestingHelper).GetMethod("StaticRoute")); var context = TestingMocks.MockContext(); route.Invoke(context); RouteTestingHelper.WhoTriggeredMe().ShouldBe("StaticRoute"); }
public void route_invoke_using_function_wrapped_method() { Func <IHttpContext, IHttpContext> function = new RouteTestingHelper().RouteTwo; var route = new Route(function); var context = TestingMocks.MockContext(); route.Invoke(context); RouteTestingHelper.WhoTriggeredMe().ShouldBe("RouteTwo"); }
public void route_invoke_using_function() { var triggeredBy = "Anon"; var context = TestingMocks.MockContext(); var route = new Route(ctx => { RouteTestingHelper.WasTriggeredBy(triggeredBy); return(ctx); }); route.Invoke(context); RouteTestingHelper.WhoTriggeredMe().ShouldBe(triggeredBy); }