/// <inheritdoc />
        public IAndRedirectTestBuilder WithUrlHelper(IUrlHelper urlHelper)
        {
            RouteActionResultValidator.ValidateUrlHelper(
                this.ActionResult,
                urlHelper,
                this.ThrowNewRedirectResultAssertionException);

            return(this);
        }
        /// <inheritdoc />
        public IAndCreatedTestBuilder WithUrlHelper(IUrlHelper urlHelper)
        {
            RouteActionResultValidator.ValidateUrlHelper(
                this.TestContext.MethodResult,
                urlHelper,
                this.ThrowNewCreatedResultAssertionException);

            return(this);
        }
        /// <summary>
        /// Tests whether the <see cref="ActionResult"/>
        /// has the same <see cref="IUrlHelper"/> as the provided one.
        /// </summary>
        /// <param name="baseTestBuilderWithUrlHelper">
        /// Instance of <see cref="IBaseTestBuilderWithUrlHelperResult{TUrlHelperResultTestBuilder}"/> type.
        /// </param>
        /// <param name="urlHelper">URL helper of type <see cref="IUrlHelper"/>.</param>
        /// <returns>The same URL helper <see cref="ActionResult"/> test builder.</returns>
        public static TUrlHelperResultTestBuilder WithUrlHelper <TUrlHelperResultTestBuilder>(
            this IBaseTestBuilderWithUrlHelperResult <TUrlHelperResultTestBuilder> baseTestBuilderWithUrlHelper,
            IUrlHelper urlHelper)
            where TUrlHelperResultTestBuilder : IBaseTestBuilderWithActionResult
        {
            var actualBuilder = GetActualBuilder(baseTestBuilderWithUrlHelper);

            RouteActionResultValidator.ValidateUrlHelper(
                actualBuilder.TestContext.MethodResult,
                urlHelper,
                actualBuilder.ThrowNewFailedValidationException);

            return(actualBuilder.ResultTestBuilder);
        }