// Copyright (c) Six Labors. // Licensed under the Six Labors Split License. using System.Reflection; namespace SixLabors.ImageSharp.Tests; /// /// Triggers passing instances which produce a blank image of size width * height. /// One instance will be passed for each the pixel format defined by the pixelTypes parameter /// public class WithTestPatternImagesAttribute : ImageDataAttributeBase { /// /// Initializes a new instance of the class. /// /// The required width /// The required height /// The requested parameter /// Additional theory parameter values public WithTestPatternImagesAttribute(int width, int height, PixelTypes pixelTypes, params object[] additionalParameters) : this(null, width, height, pixelTypes, additionalParameters) { } /// /// Initializes a new instance of the class. /// /// The member data to apply to theories /// The required width /// The required height /// The requested parameter /// Additional theory parameter values public WithTestPatternImagesAttribute(string memberData, int width, int height, PixelTypes pixelTypes, params object[] additionalParameters) : base(memberData, pixelTypes, additionalParameters) { this.Width = width; this.Height = height; } /// /// Gets the width /// public int Width { get; } /// /// Gets the height /// public int Height { get; } protected override string GetFactoryMethodName(MethodInfo testMethod) => "TestPattern"; protected override object[] GetFactoryMethodArgs(MethodInfo testMethod, Type factoryType) => new object[] { this.Width, this.Height }; }