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