public void Ctor_NullTarget_DoesNotThrow() { var method = GetMethodWithNoArgs(); var pa = ParameterizedActionFactory.CreateAction(method); Should.NotThrow(() => new ParameterizedActionTarget(null, method, pa)); }
public void Ctor_NullMethod_Throws() { var method = GetMethodWithNoArgs(); var pa = ParameterizedActionFactory.CreateAction(method); Should.Throw <ArgumentNullException> (() => new ParameterizedActionTarget("foobar", null, pa)); }
private void AddHandlerForParameterizedAction(RouteHandler routes, HttpMethodAttribute att, MethodInfo info) { ParameterizedAction action = ParameterizedActionFactory.CreateAction(info); ParameterizedActionTarget target = new ParameterizedActionTarget(this, info, action); AddImplicitRouteHandler(target, att.Patterns, att.Methods); }
private void AddDefaultHandlerForParameterizedAction(RouteHandler routes, MethodInfo info) { ParameterizedAction action = ParameterizedActionFactory.CreateAction(info); ParameterizedActionTarget target = new ParameterizedActionTarget(this, info, action); AddImplicitRouteHandler(target, new string [] { "/" + info.Name }, HttpMethods.RouteMethods); }
public void Invoke_StaticMethodNoParams_IsInvoked() { var method = GetMethod("SomeStaticActionNoParams"); var pa = ParameterizedActionFactory.CreateAction(method); pa(this, new object [] { new ManosAppStub(), new ManosContextStub() }); Assert.IsTrue(action_invoked_properly); }
public void Invoke_NonStaticMethodSingleBoolParam_IsInvoked() { var method = GetMethod("SomeActionBoolParam"); var pa = ParameterizedActionFactory.CreateAction(method); pa(this, new object [] { new ManosAppStub(), new ManosContextStub(), true }); Assert.IsTrue(action_invoked_properly); }
public void Invoke_StaticMethodTwoStringsShouldMatch_MatchingStringsMatch() { var method = GetMethod("SomeStaticActionTwoStringsShouldMatch"); var pa = ParameterizedActionFactory.CreateAction(method); pa(this, new object [] { new ManosAppStub(), new ManosContextStub(), "foo", "foo" }); Assert.IsTrue(action_invoked_properly); }