// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // namespace ImageSharp.Tests { using System; using System.Reflection; /// /// Triggers passing instances which produce an image of size width * height filled with the requested color. /// One instance will be passed for each the pixel format defined by the pixelTypes parameter /// public class WithSolidFilledImagesAttribute : WithBlankImagesAttribute { /// /// Triggers passing instances which produce an image of size width * height filled with the requested color. /// One instance will be passed for each the pixel format defined by the pixelTypes parameter /// /// The width of the requested image /// The height of the requested image /// Red /// Green /// Blue /// The requested pixel types /// Additional theory parameter values public WithSolidFilledImagesAttribute( int width, int height, byte r, byte g, byte b, PixelTypes pixelTypes, params object[] additionalParameters) : this(width, height, r, g, b, 255, pixelTypes, additionalParameters) { } /// /// Triggers passing instances which produce an image of size width * height filled with the requested color. /// One instance will be passed for each the pixel format defined by the pixelTypes parameter /// /// The width of the requested image /// The height of the requested image /// Red /// Green /// Blue /// /// Alpha /// The requested pixel types /// Additional theory parameter values public WithSolidFilledImagesAttribute( int width, int height, byte r, byte g, byte b, byte a, PixelTypes pixelTypes, params object[] additionalParameters) : base(width, height, pixelTypes, additionalParameters) { this.R = r; this.G = g; this.B = b; this.A = a; } /// /// Red /// public byte R { get; } /// /// Green /// public byte G { get; } /// /// Blue /// public byte B { get; } /// /// Alpha /// public byte A { get; } protected override object[] GetFactoryMethodArgs(MethodInfo testMethod, Type factoryType) => new object[] { this.Width, this.Height, this.R, this.G, this.B, this.A }; protected override string GetFactoryMethodName(MethodInfo testMethod) => "Solid"; } }