// // 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 read an image from the given file /// One instance will be passed for each the pixel format defined by the pixelTypes parameter /// public class WithFileAttribute : ImageDataAttributeBase { private readonly string fileName; /// /// Triggers passing instances which read an image from the given file /// One instance will be passed for each the pixel format defined by the pixelTypes parameter /// /// The name of the file /// The requested pixel types /// Additional theory parameter values public WithFileAttribute(string fileName, PixelTypes pixelTypes, params object[] additionalParameters) : base(pixelTypes, additionalParameters) { this.fileName = fileName; } protected override object[] GetFactoryMethodArgs(MethodInfo testMethod, Type factoryType) => new object[] { this.fileName }; protected override string GetFactoryMethodName(MethodInfo testMethod) => "File"; } }