Exemplo n.º 1
0
 private void TestNoRouteValue(IT4MVCActionResult actionResult, string name)
 {
     Assert.IsFalse(actionResult.RouteValueDictionary.ContainsKey(name));
 }
Exemplo n.º 2
0
 private void TestRouteValue(IT4MVCActionResult actionResult, string name, object value)
 {
     Assert.AreEqual(value, actionResult.RouteValueDictionary[name]);
 }
Exemplo n.º 3
0
        // HELPER METHODS

        private void TestAreaControllerActionNames(IT4MVCActionResult actionResult, string area, string controller, string action)
        {
            if (UseLowerCaseNames)
            {
                area = area.ToLowerInvariant();
                controller = controller.ToLowerInvariant();
                action = action.ToLowerInvariant();
            }

            TestRouteValue(actionResult, "area", area);
            TestRouteValue(actionResult, "controller", controller);
            TestRouteValue(actionResult, "action", action);
        }
Exemplo n.º 4
0
 private void TestRouteValue(IT4MVCActionResult actionResult, string name, object value)
 {
     Assert.IsTrue(actionResult.RouteValueDictionary.ContainsKey(name));
     Assert.AreEqual(value, actionResult.RouteValueDictionary[name]);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Generates an anchor tag (link) with an image inside such that the image when clicked follows the specified MVC route.
        /// </summary>
        /// <param name="helper">The class being extended with this method.</param>
        /// <param name="result">An IT4MVCActionResult from a T4 MVC action method used to help build urls.</param>
        /// <param name="imageFileName">The file name of the image including full relative path.  Recommend coming from T4MVC Links property.</param>
        /// <param name="anchorHtmlAttributes">A dynamic object with name and value pairs for the anchor tag.  Example:  new {data-custom1="abc", @class="large"}</param>
        /// <param name="imageHtmlAttributes">A dynamic object with name and value pairs for the image tag.  Example:  new {data-custom1="abc", @class="large"}</param>
        /// <returns></returns>
        public static MvcHtmlString ActionImageTag(this HtmlHelper helper, ActionResult result, string imageFileName, object anchorHtmlAttributes, object imageHtmlAttributes)
        {
            IT4MVCActionResult t4 = result.GetT4MVCResult();

            return(ActionImageTag(helper, t4.Action, t4.Controller, imageFileName, t4.RouteValueDictionary, anchorHtmlAttributes, imageHtmlAttributes));
        }
Exemplo n.º 6
0
 private void TestNoRouteValue(IT4MVCActionResult actionResult, string name)
 {
     Assert.IsFalse(actionResult.RouteValueDictionary.ContainsKey(name));
 }
Exemplo n.º 7
0
 private void TestRouteValue(IT4MVCActionResult actionResult, string name, object value)
 {
     Assert.IsTrue(actionResult.RouteValueDictionary.ContainsKey(name));
     Assert.AreEqual(value, actionResult.RouteValueDictionary[name]);
 }
Exemplo n.º 8
0
 private void TestRouteValue(IT4MVCActionResult actionResult, string name, object value) {
     Assert.AreEqual(value, actionResult.RouteValueDictionary[name]);
 }
Exemplo n.º 9
0
        protected RedirectToRouteResult RedirectToAction(ActionResult result)
        {
            IT4MVCActionResult callInfo = result.GetT4MVCResult();

            return(this.RedirectToRoute(callInfo.RouteValueDictionary));
        }