/// <inheritdoc />
        public IAndRedirectTestBuilder ContainingRouteValues(IDictionary <string, object> routeValues)
        {
            RouteActionResultValidator.ValidateRouteValues(
                this.ActionResult,
                routeValues,
                this.IncludeCountCheck,
                this.ThrowNewRedirectResultAssertionException);

            return(this);
        }
Exemple #2
0
        /// <inheritdoc />
        public IAndCreatedTestBuilder ContainingRouteValues(IDictionary <string, object> routeValues)
        {
            var includeCountCheck = this.createdAtExpression == null;

            RouteActionResultValidator.ValidateRouteValues(
                this.ActionResult,
                routeValues,
                includeCountCheck,
                this.ThrowNewCreatedResultAssertionException);

            return(this);
        }
Exemple #3
0
        /// <summary>
        /// Tests whether the <see cref="Microsoft.AspNetCore.Mvc.ActionResult"/>
        /// contains the provided route values.
        /// </summary>
        /// <param name="baseTestBuilderWithRouteValuesResult">
        /// Instance of <see cref="IBaseTestBuilderWithRouteValuesResult{TRouteValuesResultTestBuilder}"/> type.
        /// </param>
        /// <param name="routeValues">Expected route value dictionary.</param>
        /// <returns>The same route values <see cref="Microsoft.AspNetCore.Mvc.ActionResult"/> test builder.</returns>
        public static TRouteValuesResultTestBuilder ContainingRouteValues <TRouteValuesResultTestBuilder>(
            this IBaseTestBuilderWithRouteValuesResult <TRouteValuesResultTestBuilder> baseTestBuilderWithRouteValuesResult,
            IDictionary <string, object> routeValues)
            where TRouteValuesResultTestBuilder : IBaseTestBuilderWithActionResult
        {
            var actualBuilder = GetActualBuilder(baseTestBuilderWithRouteValuesResult);

            RouteActionResultValidator.ValidateRouteValues(
                actualBuilder.TestContext.MethodResult,
                routeValues,
                actualBuilder.IncludeCountCheck,
                actualBuilder.ThrowNewFailedValidationException);

            return(actualBuilder.ResultTestBuilder);
        }