Пример #1
0
        /// <summary>
        /// Creates a <see cref="XElement"/> for this command.
        /// </summary>
        /// <param name="executor">Executor for <see cref="ActionResult"/>s.</param>
        /// <returns>A <see cref="XElement"/> for this command.</returns>
        internal override XElement CreateCommandXElement(ActionResultExecutor executor)
        {
            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            var script = _script ?? executor.Execute(_javaScriptResult);

            return(new XElement("eval", script));
        }
        public void Execute_NullActionResult_ThrowsArgumentNullException()
        {
            var controllerContext = Substitute.For<ControllerContext>();
              controllerContext.RouteData = Substitute.For<RouteData>();
              controllerContext.Controller = Substitute.For<Controller>();
              var executor = new ActionResultExecutor(controllerContext);

              Action action = () => executor.Execute(null);

              action.ShouldThrow<ArgumentNullException>();
        }
Пример #3
0
        /// <summary>
        /// Creates a <see cref="XElement"/> for this command.
        /// </summary>
        /// <param name="executor">Executor for <see cref="ActionResult"/>s.</param>
        /// <returns>A <see cref="XElement"/> for this command.</returns>
        internal override XElement CreateCommandXElement(ActionResultExecutor executor)
        {
            if (executor == null)
            {
                throw new ArgumentNullException("executor");
            }

            // Use the HTML content or execute the PartialViewResult.
            var content = Html ?? executor.Execute(Partial);

            return(new XElement(_command,
                                new XAttribute("select", Selector),
                                new XCData(content)));
        }
Пример #4
0
        /// <summary>
        /// Creates a <see cref="XElement"/> for this command.
        /// </summary>
        /// <param name="executor">Executor for <see cref="ActionResult"/>s.</param>
        /// <returns>A <see cref="XElement"/> for this command.</returns>
        internal override XElement CreateCommandXElement(ActionResultExecutor executor)
        {
            if (executor == null)
            throw new ArgumentNullException("executor");

              // Use the HTML content or execute the PartialViewResult.
              var content = Html ?? executor.Execute(Partial);

              return new XElement(_command,
                          new XAttribute("select", Selector),
                          new XCData(content));
        }
Пример #5
0
        /// <summary>
        /// Creates a <see cref="XElement"/> for this command.
        /// </summary>
        /// <param name="executor">Executor for <see cref="ActionResult"/>s.</param>
        /// <returns>A <see cref="XElement"/> for this command.</returns>
        internal override XElement CreateCommandXElement(ActionResultExecutor executor)
        {
            if (executor == null)
            throw new ArgumentNullException("executor");

              var script = _script ?? executor.Execute(_javaScriptResult);

              return new XElement("eval", script);
        }