/// <summary> /// Tests whether action result contains the same output formatters as the provided ones. /// </summary> /// <param name="outputFormatters">Expected collection of <see cref="IOutputFormatter"/>.</param> protected void ValidateOutputFormatters(IEnumerable <IOutputFormatter> outputFormatters) { OutputFormatterValidator.ValidateOutputFormatters( this.GetObjectResult(), outputFormatters, this.ThrowNewFailedValidationException); }
/// <summary> /// Tests whether the <see cref="ActionResult"/> /// contains the provided output formatters. /// </summary> /// <param name="baseTestBuilderWithOutputResult"> /// Instance of <see cref="IBaseTestBuilderWithOutputResult{TOutputResultTestBuilder}"/> type. /// </param> /// <param name="outputFormatters">Collection of <see cref="IOutputFormatter"/>.</param> /// <returns>The same output <see cref="ActionResult"/> test builder.</returns> public static TOutputResultTestBuilder ContainingOutputFormatters <TOutputResultTestBuilder>( this IBaseTestBuilderWithOutputResult <TOutputResultTestBuilder> baseTestBuilderWithOutputResult, IEnumerable <IOutputFormatter> outputFormatters) where TOutputResultTestBuilder : IBaseTestBuilderWithActionResult { var actualBuilder = GetActualBuilder(baseTestBuilderWithOutputResult); ValidateObjectResult(actualBuilder); OutputFormatterValidator.ValidateOutputFormatters( actualBuilder.GetObjectResult(), outputFormatters, actualBuilder.ThrowNewFailedValidationException); return(actualBuilder.ResultTestBuilder); }