/// <summary>
 /// Tests whether action result contains the same output formatter as the provided one.
 /// </summary>
 /// <param name="outputFormatter">Expected instance of <see cref="IOutputFormatter"/>.</param>
 protected void ValidateContainingOfOutputFormatter(IOutputFormatter outputFormatter)
 {
     OutputFormatterValidator.ValidateContainingOfOutputFormatter(
         this.GetObjectResult(),
         outputFormatter,
         this.ThrowNewFailedValidationException);
 }
        /// <summary>
        /// Tests whether the <see cref="ActionResult"/>
        /// contains the provided <see cref="IOutputFormatter"/>.
        /// </summary>
        /// <param name="baseTestBuilderWithOutputResult">
        /// Instance of <see cref="IBaseTestBuilderWithOutputResult{TOutputResultTestBuilder}"/> type.
        /// </param>
        /// <param name="outputFormatter">Instance of <see cref="IOutputFormatter"/>.</param>
        /// <returns>The same output <see cref="ActionResult"/> test builder.</returns>
        public static TOutputResultTestBuilder ContainingOutputFormatter <TOutputResultTestBuilder>(
            this IBaseTestBuilderWithOutputResult <TOutputResultTestBuilder> baseTestBuilderWithOutputResult,
            IOutputFormatter outputFormatter)
            where TOutputResultTestBuilder : IBaseTestBuilderWithActionResult
        {
            var actualBuilder = GetActualBuilder(baseTestBuilderWithOutputResult);

            ValidateObjectResult(actualBuilder);

            OutputFormatterValidator.ValidateContainingOfOutputFormatter(
                actualBuilder.GetObjectResult(),
                outputFormatter,
                actualBuilder.ThrowNewFailedValidationException);

            return(actualBuilder.ResultTestBuilder);
        }