Browse Source

renamed TestImageFactory --to--> TestImageProvider

af/merge-core
antonfirsov 10 years ago
parent
commit
c62e12248a
  1. 12
      tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs
  2. 12
      tests/ImageSharp.Tests/Image/PixelAccessorTests.cs
  3. 4
      tests/ImageSharp.Tests/TestUtilities/ImageDataAttributeBase.cs
  4. 4
      tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs
  5. 4
      tests/ImageSharp.Tests/TestUtilities/PixelTypes.cs
  6. 57
      tests/ImageSharp.Tests/TestUtilities/TestImageProvider.cs
  7. 55
      tests/ImageSharp.Tests/TestUtilities/Tests/TestImageFactoryTests.cs
  8. 14
      tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs
  9. 6
      tests/ImageSharp.Tests/TestUtilities/WithBlankImageAttribute.cs
  10. 8
      tests/ImageSharp.Tests/TestUtilities/WithFileAttribute.cs
  11. 8
      tests/ImageSharp.Tests/TestUtilities/WithFileCollectionAttribute.cs
  12. 8
      tests/ImageSharp.Tests/TestUtilities/WithMemberFactoryAttribute.cs
  13. 12
      tests/ImageSharp.Tests/TestUtilities/WithSolidFilledImagesAttribute.cs

12
tests/ImageSharp.Tests/Formats/Jpg/JpegTests.cs

@ -27,12 +27,12 @@ namespace ImageSharp.Tests.Formats.Jpg
[Theory]
//[WithFileCollection(nameof(AllJpegFiles), PixelTypes.All)]
[WithFileCollection(nameof(AllJpegFiles), PixelTypes.Color | PixelTypes.Argb)]
public void OpenJpeg_SaveBmp<TColor>(TestImageFactory<TColor> factory)
public void OpenJpeg_SaveBmp<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var image = factory.Create();
var image = provider.GetImage();
factory.Utility.SaveTestOutputFile(image, "bmp");
provider.Utility.SaveTestOutputFile(image, "bmp");
}
@ -41,12 +41,12 @@ namespace ImageSharp.Tests.Formats.Jpg
[Theory]
[WithFileCollection(nameof(AllBmpFiles), PixelTypes.Color | PixelTypes.Argb, JpegSubsample.Ratio420, 75)]
[WithFileCollection(nameof(AllBmpFiles), PixelTypes.Color | PixelTypes.Argb, JpegSubsample.Ratio444, 75)]
public void OpenBmp_SaveJpeg<TColor>(TestImageFactory<TColor> factory, JpegSubsample subSample, int quality)
public void OpenBmp_SaveJpeg<TColor>(TestImageProvider<TColor> provider, JpegSubsample subSample, int quality)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var image = factory.Create();
var image = provider.GetImage();
var utility = factory.Utility;
var utility = provider.Utility;
utility.TestName += "_" + subSample + "_Q" + quality;
using (var outputStream = File.OpenWrite(utility.GetTestOutputFileName("jpg")))

12
tests/ImageSharp.Tests/Image/PixelAccessorTests.cs

@ -46,10 +46,10 @@ namespace ImageSharp.Tests
[WithMemberFactory(nameof(CreateTestImage), PixelTypes.All, ComponentOrder.ZYX)]
[WithMemberFactory(nameof(CreateTestImage), PixelTypes.All, ComponentOrder.XYZW)]
[WithMemberFactory(nameof(CreateTestImage), PixelTypes.All, ComponentOrder.ZYXW)]
public void CopyTo_Then_CopyFrom_OnFullImageRect<TColor>(TestImageFactory<TColor> factory, ComponentOrder order)
public void CopyTo_Then_CopyFrom_OnFullImageRect<TColor>(TestImageProvider<TColor> provider, ComponentOrder order)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var src = factory.Create();
var src = provider.GetImage();
var dest = new Image<TColor>(src.Width, src.Height);
@ -90,11 +90,11 @@ namespace ImageSharp.Tests
[WithBlankImages(16, 16, PixelTypes.All, ComponentOrder.ZYX)]
[WithBlankImages(16, 16, PixelTypes.All, ComponentOrder.XYZW)]
[WithBlankImages(16, 16, PixelTypes.All, ComponentOrder.ZYXW)]
public void CopyTo_Then_CopyFrom_WithOffset<TColor>(TestImageFactory<TColor> factory, ComponentOrder order)
public void CopyTo_Then_CopyFrom_WithOffset<TColor>(TestImageProvider<TColor> provider, ComponentOrder order)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var srcImage = factory.Create();
var srcImage = provider.GetImage();
var color = default(TColor);
color.PackFromBytes(255, 0, 0, 255);
@ -116,8 +116,8 @@ namespace ImageSharp.Tests
}
}
factory.Utility.SourceFileOrDescription = order.ToString();
factory.Utility.SaveTestOutputFile(destImage, "bmp");
provider.Utility.SourceFileOrDescription = order.ToString();
provider.Utility.SaveTestOutputFile(destImage, "bmp");
var expectedImage = new Image<TColor>(8, 8).Fill(color);

4
tests/ImageSharp.Tests/TestUtilities/ImageDataAttributeBase.cs

@ -12,7 +12,7 @@ namespace ImageSharp.Tests.TestUtilities
using Xunit.Sdk;
/// <summary>
/// Base class for Theory Data attributes which pass an instance of <see cref="TestImageFactory{TColor,TPacked}"/> to the test cases.
/// Base class for Theory Data attributes which pass an instance of <see cref="TestImageProvider{TColor}"/> to the test cases.
/// </summary>
public abstract class ImageDataAttributeBase : DataAttribute
{
@ -37,7 +37,7 @@ namespace ImageSharp.Tests.TestUtilities
{
foreach (var pixelType in this.PixelTypes.ToTypes())
{
var factoryType = typeof(TestImageFactory<>).MakeGenericType(pixelType);
var factoryType = typeof(TestImageProvider<>).MakeGenericType(pixelType);
foreach (object[] originalFacoryMethodArgs in this.GetAllFactoryMethodArgs(testMethod, factoryType))
{

4
tests/ImageSharp.Tests/TestUtilities/ImagingTestCaseUtility.cs

@ -18,12 +18,12 @@ namespace ImageSharp.Tests.TestUtilities
public class ImagingTestCaseUtility
{
/// <summary>
/// Name of the TColor in the owner <see cref="TestImageFactory{TColor}"/>
/// Name of the TColor in the owner <see cref="TestImageProvider{TColor}"/>
/// </summary>
public string PixelTypeName { get; set; } = string.Empty;
/// <summary>
/// The name of the file which is provided by <see cref="TestImageFactory{TColor}"/>
/// The name of the file which is provided by <see cref="TestImageProvider{TColor}"/>
/// Or a short string describing the image in the case of a non-file based image provider.
/// </summary>
public string SourceFileOrDescription { get; set; } = string.Empty;

4
tests/ImageSharp.Tests/TestUtilities/PixelTypes.cs

@ -8,7 +8,7 @@ namespace ImageSharp.Tests.TestUtilities
/// <summary>
/// Flags that are mapped to PackedPixel types.
/// They trigger the desired parametrization for <see cref="TestImageFactory{TColor}"/>.
/// They trigger the desired parametrization for <see cref="TestImageProvider{TColor}"/>.
/// </summary>
[Flags]
public enum PixelTypes : uint
@ -48,7 +48,7 @@ namespace ImageSharp.Tests.TestUtilities
Short2 = 1 << 15,
Short4 = 1 << 16,
// TODO: Add multi-flag entries by rules defined in PackedPixelConverterHelper
// "All" is handled as a separate, individual case instead of using bitwise OR

57
tests/ImageSharp.Tests/TestUtilities/TestImageFactory.cs → tests/ImageSharp.Tests/TestUtilities/TestImageProvider.cs

@ -1,4 +1,4 @@
// <copyright file="TestImageFactory.cs" company="James Jackson-South">
// <copyright file="TestImageProvider.cs" company="James Jackson-South">
// Copyright (c) James Jackson-South and contributors.
// Licensed under the Apache License, Version 2.0.
// </copyright>
@ -13,10 +13,13 @@ namespace ImageSharp.Tests.TestUtilities
/// Provides <see cref="Image{TColor}" /> instances for parametric unit tests.
/// </summary>
/// <typeparam name="TColor">The pixel format of the image</typeparam>
public abstract class TestImageFactory<TColor> : ITestImageFactory
public abstract class TestImageProvider<TColor> : ITestImageFactory
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
public abstract Image<TColor> Create();
/// <summary>
/// Returns an <see cref="Image{TColor}"/> instance to the test case with the necessary traits.
/// </summary>
public abstract Image<TColor> GetImage();
public virtual string SourceFileOrDescription => "";
@ -25,11 +28,7 @@ namespace ImageSharp.Tests.TestUtilities
/// </summary>
public ImagingTestCaseUtility Utility { get; private set; }
protected TestImageFactory()
{
}
protected virtual TestImageFactory<TColor> InitUtility(MethodInfo testMethod)
protected virtual TestImageProvider<TColor> InitUtility(MethodInfo testMethod)
{
this.Utility = new ImagingTestCaseUtility()
{
@ -45,13 +44,13 @@ namespace ImageSharp.Tests.TestUtilities
return this;
}
private class BlankFactory : TestImageFactory<TColor>
private class BlankProvider : TestImageProvider<TColor>
{
protected int Width { get; }
protected int Height { get; }
public BlankFactory(int width, int height)
public BlankProvider(int width, int height)
{
this.Width = width;
this.Height = height;
@ -59,43 +58,43 @@ namespace ImageSharp.Tests.TestUtilities
public override string SourceFileOrDescription => $"Blank{this.Width}x{this.Height}";
public override Image<TColor> Create() => new Image<TColor>(this.Width, this.Height);
public override Image<TColor> GetImage() => new Image<TColor>(this.Width, this.Height);
}
public static TestImageFactory<TColor> Blank(int width, int height, MethodInfo testMethod = null)
=> new BlankFactory(width, height).InitUtility(testMethod);
public static TestImageProvider<TColor> Blank(int width, int height, MethodInfo testMethod = null)
=> new BlankProvider(width, height).InitUtility(testMethod);
private class LambdaFactory : TestImageFactory<TColor>
private class LambdaProvider : TestImageProvider<TColor>
{
private readonly Func<Image<TColor>> creator;
public LambdaFactory(Func<Image<TColor>> creator)
public LambdaProvider(Func<Image<TColor>> creator)
{
this.creator = creator;
}
public override Image<TColor> Create() => this.creator();
public override Image<TColor> GetImage() => this.creator();
}
public static TestImageFactory<TColor> Lambda(
public static TestImageProvider<TColor> Lambda(
Func<Image<TColor>> func,
MethodInfo testMethod = null) => new LambdaFactory(func).InitUtility(testMethod);
MethodInfo testMethod = null) => new LambdaProvider(func).InitUtility(testMethod);
private class FileFactory : TestImageFactory<TColor>
private class FileProvider : TestImageProvider<TColor>
{
private static ConcurrentDictionary<string, Image<TColor>> cache =
new ConcurrentDictionary<string, Image<TColor>>();
private string filePath;
public FileFactory(string filePath)
public FileProvider(string filePath)
{
this.filePath = filePath;
}
public override string SourceFileOrDescription => this.filePath;
public override Image<TColor> Create()
public override Image<TColor> GetImage()
{
var cachedImage = cache.GetOrAdd(
this.filePath,
@ -109,12 +108,12 @@ namespace ImageSharp.Tests.TestUtilities
}
}
public static TestImageFactory<TColor> File(string filePath, MethodInfo testMethod = null)
public static TestImageProvider<TColor> File(string filePath, MethodInfo testMethod = null)
{
return new FileFactory(filePath).InitUtility(testMethod);
return new FileProvider(filePath).InitUtility(testMethod);
}
private class SolidFactory : BlankFactory
private class SolidProvider : BlankProvider
{
private readonly byte r;
@ -124,16 +123,16 @@ namespace ImageSharp.Tests.TestUtilities
private readonly byte a;
public override Image<TColor> Create()
public override Image<TColor> GetImage()
{
var image = base.Create();
var image = base.GetImage();
TColor color = default(TColor);
color.PackFromBytes(this.r, this.g, this.b, this.a);
return image.Fill(color);
}
public SolidFactory(int width, int height, byte r, byte g, byte b, byte a)
public SolidProvider(int width, int height, byte r, byte g, byte b, byte a)
: base(width, height)
{
this.r = r;
@ -143,7 +142,7 @@ namespace ImageSharp.Tests.TestUtilities
}
}
public static TestImageFactory<TColor> Solid(
public static TestImageProvider<TColor> Solid(
int width,
int height,
byte r,
@ -152,7 +151,7 @@ namespace ImageSharp.Tests.TestUtilities
byte a = 255,
MethodInfo testMethod = null)
{
return new SolidFactory(width, height, r, g, b, a).InitUtility(testMethod);
return new SolidProvider(width, height, r, g, b, a).InitUtility(testMethod);
}
}

55
tests/ImageSharp.Tests/TestUtilities/TestImageFactoryTests.cs → tests/ImageSharp.Tests/TestUtilities/Tests/TestImageFactoryTests.cs

@ -4,10 +4,9 @@
// </copyright>
// ReSharper disable InconsistentNaming
namespace ImageSharp.Tests.TestUtilities
namespace ImageSharp.Tests.TestUtilities.Tests
{
using System;
using System.IO;
using Xunit;
using Xunit.Abstractions;
@ -26,11 +25,11 @@ namespace ImageSharp.Tests.TestUtilities
[Theory]
[WithBlankImages(42, 666, PixelTypes.Color | PixelTypes.Argb | PixelTypes.HalfSingle, "hello")]
public void Use_WithEmptyImageAttribute<TColor>(
TestImageFactory<TColor> factory,
TestImageProvider<TColor> provider,
string message)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var img = factory.Create();
var img = provider.GetImage();
Assert.Equal(42, img.Width);
Assert.Equal(666, img.Height);
@ -40,11 +39,11 @@ namespace ImageSharp.Tests.TestUtilities
[Theory]
[WithBlankImages(42, 666, PixelTypes.All, "hello")]
public void Use_WithBlankImagesAttribute_WithAllPixelTypes<TColor>(
TestImageFactory<TColor> factory,
TestImageProvider<TColor> provider,
string message)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var img = factory.Create();
var img = provider.GetImage();
Assert.Equal(42, img.Width);
Assert.Equal(666, img.Height);
@ -55,16 +54,16 @@ namespace ImageSharp.Tests.TestUtilities
[Theory]
[WithFile(TestImages.Bmp.Car, PixelTypes.All, 88)]
[WithFile(TestImages.Bmp.F, PixelTypes.All, 88)]
public void Use_WithFileAttribute<TColor>(TestImageFactory<TColor> factory, int yo)
public void Use_WithFileAttribute<TColor>(TestImageProvider<TColor> provider, int yo)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
Assert.NotNull(factory.Utility.SourceFileOrDescription);
var img = factory.Create();
Assert.NotNull(provider.Utility.SourceFileOrDescription);
var img = provider.GetImage();
Assert.True(img.Width * img.Height > 0);
Assert.Equal(88, yo);
string fn = factory.Utility.GetTestOutputFileName("jpg");
string fn = provider.Utility.GetTestOutputFileName("jpg");
this.Output.WriteLine(fn);
}
@ -72,20 +71,20 @@ namespace ImageSharp.Tests.TestUtilities
[Theory]
[WithFileCollection(nameof(AllBmpFiles), PixelTypes.Color | PixelTypes.Argb)]
public void Use_WithFileCollection<TColor>(TestImageFactory<TColor> factory)
public void Use_WithFileCollection<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
Assert.NotNull(factory.Utility.SourceFileOrDescription);
var image = factory.Create();
factory.Utility.SaveTestOutputFile(image, "png");
Assert.NotNull(provider.Utility.SourceFileOrDescription);
var image = provider.GetImage();
provider.Utility.SaveTestOutputFile(image, "png");
}
[Theory]
[WithSolidFilledImages(10, 20, 255, 100, 50, 200, PixelTypes.Color | PixelTypes.Argb)]
public void Use_WithSolidFilledImagesAttribute<TColor>(TestImageFactory<TColor> factory)
public void Use_WithSolidFilledImagesAttribute<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var img = factory.Create();
var img = provider.GetImage();
Assert.Equal(img.Width, 10);
Assert.Equal(img.Height, 20);
@ -116,18 +115,18 @@ namespace ImageSharp.Tests.TestUtilities
[Theory]
[WithMemberFactory(nameof(TestMemberFactory), PixelTypes.All)]
public void Use_WithMemberFactoryAttribute<TColor>(TestImageFactory<TColor> factory)
public void Use_WithMemberFactoryAttribute<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var img = factory.Create();
var img = provider.GetImage();
Assert.Equal(img.Width, 3);
}
public static readonly TheoryData<ITestImageFactory> BasicData = new TheoryData<ITestImageFactory>()
{
TestImageFactory<Color>.Blank(10, 20),
TestImageFactory<HalfVector4>.Blank(
TestImageProvider<Color>.Blank(10, 20),
TestImageProvider<HalfVector4>.Blank(
10,
20)
};
@ -135,31 +134,31 @@ namespace ImageSharp.Tests.TestUtilities
[Theory]
[MemberData(nameof(BasicData))]
public void Blank_MemberData<TColor>(TestImageFactory<TColor> factory)
public void Blank_MemberData<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var img = factory.Create();
var img = provider.GetImage();
Assert.True(img.Width * img.Height > 0);
}
public static readonly TheoryData<ITestImageFactory> FileData = new TheoryData<ITestImageFactory>()
{
TestImageFactory<Color>.File(
TestImageProvider<Color>.File(
TestImages.Bmp.Car),
TestImageFactory<HalfVector4>.File(
TestImageProvider<HalfVector4>.File(
TestImages.Bmp.F)
};
[Theory]
[MemberData(nameof(FileData))]
public void File_MemberData<TColor>(TestImageFactory<TColor> factory)
public void File_MemberData<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
this.Output.WriteLine("SRC: " + factory.Utility.SourceFileOrDescription);
this.Output.WriteLine("OUT: " + factory.Utility.GetTestOutputFileName());
this.Output.WriteLine("SRC: " + provider.Utility.SourceFileOrDescription);
this.Output.WriteLine("OUT: " + provider.Utility.GetTestOutputFileName());
var img = factory.Create();
var img = provider.GetImage();
Assert.True(img.Width * img.Height > 0);
}

14
tests/ImageSharp.Tests/TestUtilities/TestUtilityExtensionsTests.cs → tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs

@ -4,7 +4,7 @@
// </copyright>
// ReSharper disable InconsistentNaming
namespace ImageSharp.Tests.TestUtilities
namespace ImageSharp.Tests.TestUtilities.Tests
{
using System;
using System.Linq;
@ -68,11 +68,11 @@ namespace ImageSharp.Tests.TestUtilities
[Theory]
[WithFile(TestImages.Bmp.Car, PixelTypes.Color)]
public void IsEquivalentTo_WhenFalse<TColor>(TestImageFactory<TColor> factory)
public void IsEquivalentTo_WhenFalse<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var a = factory.Create();
var b = factory.Create();
var a = provider.GetImage();
var b = provider.GetImage();
b = b.OilPaint(3, 2);
Assert.False(a.IsEquivalentTo(b));
@ -80,11 +80,11 @@ namespace ImageSharp.Tests.TestUtilities
[Theory]
[WithMemberFactory(nameof(CreateTestImage), PixelTypes.Color | PixelTypes.Bgr565)]
public void IsEquivalentTo_WhenTrue<TColor>(TestImageFactory<TColor> factory)
public void IsEquivalentTo_WhenTrue<TColor>(TestImageProvider<TColor> provider)
where TColor : struct, IPackedPixel, IEquatable<TColor>
{
var a = factory.Create();
var b = factory.Create();
var a = provider.GetImage();
var b = provider.GetImage();
Assert.True(a.IsEquivalentTo(b));
}

6
tests/ImageSharp.Tests/TestUtilities/WithBlankImageAttribute.cs

@ -9,13 +9,13 @@ namespace ImageSharp.Tests.TestUtilities
using System.Reflection;
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which produce a blank image of size width * height.
/// One <see cref="TestImageFactory{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which produce a blank image of size width * height.
/// One <see cref="TestImageProvider{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
public class WithBlankImagesAttribute : ImageDataAttributeBase
{
/// <summary>
/// Triggers passing an <see cref="TestImageFactory{TColor}"/> that produces a blank image of size width * height
/// Triggers passing an <see cref="TestImageProvider{TColor}"/> that produces a blank image of size width * height
/// </summary>
/// <param name="width">The required width</param>
/// <param name="height">The required height</param>

8
tests/ImageSharp.Tests/TestUtilities/WithFileAttribute.cs

@ -9,16 +9,16 @@ namespace ImageSharp.Tests.TestUtilities
using System.Reflection;
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which read an image from the given file
/// One <see cref="TestImageFactory{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which read an image from the given file
/// One <see cref="TestImageProvider{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
public class WithFileAttribute : ImageDataAttributeBase
{
private readonly string fileName;
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which read an image from the given file
/// One <see cref="TestImageFactory{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which read an image from the given file
/// One <see cref="TestImageProvider{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
/// <param name="fileName">The name of the file</param>
/// <param name="pixelTypes">The requested pixel types</param>

8
tests/ImageSharp.Tests/TestUtilities/WithFileCollectionAttribute.cs

@ -10,16 +10,16 @@ namespace ImageSharp.Tests.TestUtilities
using System.Reflection;
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which read an image for each file being enumerated by the (static) test class field/property defined by enumeratorMemberName
/// <see cref="TestImageFactory{TColor}"/> instances will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which read an image for each file being enumerated by the (static) test class field/property defined by enumeratorMemberName
/// <see cref="TestImageProvider{TColor}"/> instances will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
public class WithFileCollectionAttribute : ImageDataAttributeBase
{
private readonly string enumeratorMemberName;
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which read an image for each file being enumerated by the (static) test class field/property defined by enumeratorMemberName
/// <see cref="TestImageFactory{TColor}"/> instances will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which read an image for each file being enumerated by the (static) test class field/property defined by enumeratorMemberName
/// <see cref="TestImageProvider{TColor}"/> instances will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
/// <param name="enumeratorMemberName">The name of the static test class field/property enumerating the files</param>
/// <param name="pixelTypes">The requested pixel types</param>

8
tests/ImageSharp.Tests/TestUtilities/WithMemberFactoryAttribute.cs

@ -9,16 +9,16 @@ namespace ImageSharp.Tests.TestUtilities
using System.Reflection;
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which return the image produced by the given test class member method
/// <see cref="TestImageFactory{TColor}"/> instances will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which return the image produced by the given test class member method
/// <see cref="TestImageProvider{TColor}"/> instances will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
public class WithMemberFactoryAttribute : ImageDataAttributeBase
{
private readonly string memberMethodName;
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which return the image produced by the given test class member method
/// <see cref="TestImageFactory{TColor}"/> instances will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which return the image produced by the given test class member method
/// <see cref="TestImageProvider{TColor}"/> instances will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
/// <param name="memberMethodName">The name of the static test class which returns the image</param>
/// <param name="pixelTypes">The requested pixel types</param>

12
tests/ImageSharp.Tests/TestUtilities/WithSolidFilledImagesAttribute.cs

@ -8,14 +8,14 @@ namespace ImageSharp.Tests.TestUtilities
using System.Reflection;
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which produce an image of size width * height filled with the requested color.
/// One <see cref="TestImageFactory{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which produce an image of size width * height filled with the requested color.
/// One <see cref="TestImageProvider{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
public class WithSolidFilledImagesAttribute : WithBlankImagesAttribute
{
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which produce an image of size width * height filled with the requested color.
/// One <see cref="TestImageFactory{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which produce an image of size width * height filled with the requested color.
/// One <see cref="TestImageProvider{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
/// <param name="width">The width of the requested image</param>
/// <param name="height">The height of the requested image</param>
@ -37,8 +37,8 @@ namespace ImageSharp.Tests.TestUtilities
}
/// <summary>
/// Triggers passing <see cref="TestImageFactory{TColor}"/> instances which produce an image of size width * height filled with the requested color.
/// One <see cref="TestImageFactory{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// Triggers passing <see cref="TestImageProvider{TColor}"/> instances which produce an image of size width * height filled with the requested color.
/// One <see cref="TestImageProvider{TColor}"/> instance will be passed for each the pixel format defined by the pixelTypes parameter
/// </summary>
/// <param name="width">The width of the requested image</param>
/// <param name="height">The height of the requested image</param>

Loading…
Cancel
Save