Example #1
0
 /// <summary>
 /// Tests whether the collected attributes contain <see cref="ProducesAttribute"/>.
 /// </summary>
 /// <param name="controllerActionAttributesTestBuilder">
 /// Instance of <see cref="IControllerActionAttributesTestBuilder{TAttributesTestBuilder}"/> type.
 /// </param>
 /// <param name="withType">Expected type.</param>
 /// <param name="withContentTypes">Expected content types.</param>
 /// <returns>The same attributes test builder.</returns>
 public static TAttributesTestBuilder SpecifyingProduction <TAttributesTestBuilder>(
     this IControllerActionAttributesTestBuilder <TAttributesTestBuilder> controllerActionAttributesTestBuilder,
     Type withType,
     params string[] withContentTypes)
     where TAttributesTestBuilder : IControllerActionAttributesTestBuilder <TAttributesTestBuilder>
 => controllerActionAttributesTestBuilder
 .SpecifyingProduction(withType, withContentTypes.AsEnumerable());
Example #2
0
 /// <summary>
 /// Tests whether the collected attributes contain <see cref="ProducesAttribute"/>.
 /// </summary>
 /// <param name="controllerActionAttributesTestBuilder">
 /// Instance of <see cref="IControllerActionAttributesTestBuilder{TAttributesTestBuilder}"/> type.
 /// </param>
 /// <param name="withType">Expected type.</param>
 /// <param name="withContentTypes">Expected content types.</param>
 /// <returns>The same attributes test builder.</returns>
 public static TAttributesTestBuilder SpecifyingProduction <TAttributesTestBuilder>(
     this IControllerActionAttributesTestBuilder <TAttributesTestBuilder> controllerActionAttributesTestBuilder,
     Type withType,
     IEnumerable <string> withContentTypes)
     where TAttributesTestBuilder : IControllerActionAttributesTestBuilder <TAttributesTestBuilder>
 => controllerActionAttributesTestBuilder
 .SpecifyingProduction(production => production
                       .OfType(withType)
                       .WithContentTypes(withContentTypes));
Example #3
0
 /// <summary>
 /// Tests whether the collected attributes contain <see cref="ProducesAttribute"/>.
 /// </summary>
 /// <param name="controllerActionAttributesTestBuilder">
 /// Instance of <see cref="IControllerActionAttributesTestBuilder{TAttributesTestBuilder}"/> type.
 /// </param>
 /// <param name="ofContentType">Expected content type.</param>
 /// <param name="withOtherContentTypes">Expected other content types.</param>
 /// <returns>The same attributes test builder.</returns>
 public static TAttributesTestBuilder SpecifyingProduction <TAttributesTestBuilder>(
     this IControllerActionAttributesTestBuilder <TAttributesTestBuilder> controllerActionAttributesTestBuilder,
     string ofContentType,
     params string[] withOtherContentTypes)
     where TAttributesTestBuilder : IControllerActionAttributesTestBuilder <TAttributesTestBuilder>
 => controllerActionAttributesTestBuilder
 .SpecifyingProduction(new List <string>(withOtherContentTypes)
 {
     ofContentType
 });
Example #4
0
 /// <summary>
 /// Tests whether the collected attributes contain <see cref="ProducesAttribute"/>.
 /// </summary>
 /// <param name="controllerActionAttributesTestBuilder">
 /// Instance of <see cref="IControllerActionAttributesTestBuilder{TAttributesTestBuilder}"/> type.
 /// </param>
 /// <param name="withType">Expected type.</param>
 /// <returns>The same attributes test builder.</returns>
 public static TAttributesTestBuilder SpecifyingProduction <TAttributesTestBuilder>(
     this IControllerActionAttributesTestBuilder <TAttributesTestBuilder> controllerActionAttributesTestBuilder,
     Type withType)
     where TAttributesTestBuilder : IControllerActionAttributesTestBuilder <TAttributesTestBuilder>
 => controllerActionAttributesTestBuilder
 .SpecifyingProduction(production => production.OfType(withType));