public void CanInvokeWithoutParamsToFill() { var controller = new SDController(); var context = services.ControllerContextFactory. Create("", "home", "stringparam", services.ControllerDescriptorProvider.BuildDescriptor(controller)); controller.Process(engineContext, context); Assert.IsTrue(controller.parameters.Count != 0); Assert.IsNull(controller.parameters[0]); }
public void CanInvokeWithoutParamsToFill() { var controller = new SDController(); var context = services.ControllerContextFactory. Create("", "home", "stringparam", services.ControllerDescriptorProvider.BuildDescriptor(controller)); controller.Process(engineContext, context); Assert.IsTrue(controller.parameters.Count != 0); Assert.IsNull(controller.parameters[0]); }
public void CanFillSimpleNameParametersWithDataFromCustomParams() { var controller = new SDController(); var context = services.ControllerContextFactory. Create("", "home", "stringparam", services.ControllerDescriptorProvider.BuildDescriptor(controller)); context.CustomActionParameters["name"] = "hammett"; controller.Process(engineContext, context); Assert.IsTrue(controller.parameters.Count != 0); Assert.AreEqual("hammett", controller.parameters[0]); }
public void CanFillSimpleNameParametersWithDataFromCustomParams() { var controller = new SDController(); var context = services.ControllerContextFactory. Create("", "home", "stringparam", services.ControllerDescriptorProvider.BuildDescriptor(controller)); context.CustomActionParameters["name"] = "hammett"; controller.Process(engineContext, context); Assert.IsTrue(controller.parameters.Count != 0); Assert.AreEqual("hammett", controller.parameters[0]); }
public void CanConvertSimpleParameter() { var controller = new SDController(); request.Params.Add("age", "1"); var context = services.ControllerContextFactory. Create("", "home", "IntParam", services.ControllerDescriptorProvider.BuildDescriptor(controller)); controller.Process(engineContext, context); Assert.IsTrue(controller.parameters.Count != 0); Assert.AreEqual(1, controller.parameters[0]); }
public void CustomParamsHasPrecedenceOverParams() { var controller = new SDController(); var context = services.ControllerContextFactory. Create("", "home", "stringparam", services.ControllerDescriptorProvider.BuildDescriptor(controller)); context.CustomActionParameters["name"] = "hammett"; request.Params.Add("name", "john doe"); controller.Process(engineContext, context); Assert.IsTrue(controller.parameters.Count != 0); Assert.AreEqual("hammett", controller.parameters[0]); }
public void CustomParamsHasPrecedenceOverParams() { var controller = new SDController(); var context = services.ControllerContextFactory. Create("", "home", "stringparam", services.ControllerDescriptorProvider.BuildDescriptor(controller)); context.CustomActionParameters["name"] = "hammett"; request.Params.Add("name", "john doe"); controller.Process(engineContext, context); Assert.IsTrue(controller.parameters.Count != 0); Assert.AreEqual("hammett", controller.parameters[0]); }
public void CanConvertSimpleParameter() { var controller = new SDController(); request.Params.Add("age", "1"); var context = services.ControllerContextFactory. Create("", "home", "IntParam", services.ControllerDescriptorProvider.BuildDescriptor(controller)); controller.Process(engineContext, context); Assert.IsTrue(controller.parameters.Count != 0); Assert.AreEqual(1, controller.parameters[0]); }