mirror of https://github.com/SixLabors/ImageSharp
19 changed files with 101 additions and 37 deletions
@ -0,0 +1,17 @@ |
|||||
|
namespace SixLabors.ImageSharp.Tests |
||||
|
{ |
||||
|
using System; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// The output produced by this test class should be grouped into the specified subfolder.
|
||||
|
/// </summary>
|
||||
|
public class GroupOutputAttribute : Attribute |
||||
|
{ |
||||
|
public GroupOutputAttribute(string subfolder) |
||||
|
{ |
||||
|
this.Subfolder = subfolder; |
||||
|
} |
||||
|
|
||||
|
public string Subfolder { get; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
// ReSharper disable InconsistentNaming
|
||||
|
namespace SixLabors.ImageSharp.Tests |
||||
|
{ |
||||
|
using System.IO; |
||||
|
|
||||
|
using SixLabors.ImageSharp.PixelFormats; |
||||
|
|
||||
|
using Xunit; |
||||
|
|
||||
|
[GroupOutput("Foo")] |
||||
|
public class GroupOutputTests |
||||
|
{ |
||||
|
[Theory] |
||||
|
[WithBlankImages(1, 1, PixelTypes.Rgba32)] |
||||
|
public void OutputSubfolderName_ValueIsTakeFromGroupOutputAttribute<TPixel>(TestImageProvider<TPixel> provider) |
||||
|
where TPixel : struct, IPixel<TPixel> |
||||
|
{ |
||||
|
Assert.Equal("Foo", provider.Utility.OutputSubfolderName); |
||||
|
} |
||||
|
|
||||
|
[Theory] |
||||
|
[WithBlankImages(1,1, PixelTypes.Rgba32)] |
||||
|
public void GetTestOutputDir_ShouldDefineSubfolder<TPixel>(TestImageProvider<TPixel> provider) |
||||
|
where TPixel : struct, IPixel<TPixel> |
||||
|
{ |
||||
|
string expected = $"{Path.DirectorySeparatorChar}Foo{Path.DirectorySeparatorChar}"; |
||||
|
Assert.Contains(expected, provider.Utility.GetTestOutputDir()); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue