Browse Source

Refactored creating the output directory.

Former-commit-id: f23cc3264514e4c882d0a2ed41ffc23f9abb54ef
Former-commit-id: b9e32392f090e1fd3f0c534bad3939360d0dcecd
Former-commit-id: 6276382a7659cc1f3fed381c2cedcee611947da5
pull/1/head
dirk 9 years ago
parent
commit
c6f775877d
  1. 13
      tests/ImageProcessorCore.Tests/FileTestBase.cs
  2. 6
      tests/ImageProcessorCore.Tests/Formats/Bmp/BitmapTests.cs
  3. 36
      tests/ImageProcessorCore.Tests/Formats/GeneralFormatTests.cs
  4. 6
      tests/ImageProcessorCore.Tests/Formats/Png/PngTests.cs
  5. 12
      tests/ImageProcessorCore.Tests/Processors/Filters/AlphaTest.cs
  6. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/BackgroundColorTest.cs
  7. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/BinaryThreshold.cs
  8. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/BlackWhiteTest.cs
  9. 8
      tests/ImageProcessorCore.Tests/Processors/Filters/BlendTest.cs
  10. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/BoxBlurTest.cs
  11. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/BrightnessTest.cs
  12. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/ColorBlindnessTest.cs
  13. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/ContrastTest.cs
  14. 24
      tests/ImageProcessorCore.Tests/Processors/Filters/GlowTest.cs
  15. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/GrayscaleTest.cs
  16. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/HueTest.cs
  17. 13
      tests/ImageProcessorCore.Tests/Processors/Filters/InvertTest.cs
  18. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/KodachromeTest.cs
  19. 13
      tests/ImageProcessorCore.Tests/Processors/Filters/LomographTest.cs
  20. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/PolaroidTest.cs
  21. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/SaturationTest.cs
  22. 6
      tests/ImageProcessorCore.Tests/Processors/Filters/SepiaTest.cs
  23. 24
      tests/ImageProcessorCore.Tests/Processors/Filters/VignetteTest.cs
  24. 6
      tests/ImageProcessorCore.Tests/Processors/Samplers/AutoOrientTests.cs
  25. 6
      tests/ImageProcessorCore.Tests/Processors/Samplers/CropTest.cs
  26. 12
      tests/ImageProcessorCore.Tests/Processors/Samplers/DetectEdgesTest.cs
  27. 6
      tests/ImageProcessorCore.Tests/Processors/Samplers/EntropyCropTest.cs
  28. 6
      tests/ImageProcessorCore.Tests/Processors/Samplers/FlipTests.cs
  29. 6
      tests/ImageProcessorCore.Tests/Processors/Samplers/GuassianBlurTest.cs
  30. 6
      tests/ImageProcessorCore.Tests/Processors/Samplers/GuassianSharpenTest.cs
  31. 12
      tests/ImageProcessorCore.Tests/Processors/Samplers/OilPaintTest.cs
  32. 6
      tests/ImageProcessorCore.Tests/Processors/Samplers/PadTest.cs
  33. 12
      tests/ImageProcessorCore.Tests/Processors/Samplers/PixelateTest.cs
  34. 52
      tests/ImageProcessorCore.Tests/Processors/Samplers/ResizeTests.cs
  35. 6
      tests/ImageProcessorCore.Tests/Processors/Samplers/RotateFlipTest.cs
  36. 12
      tests/ImageProcessorCore.Tests/Processors/Samplers/RotateTest.cs
  37. 6
      tests/ImageProcessorCore.Tests/Processors/Samplers/SkewTest.cs

13
tests/ImageProcessorCore.Tests/FileTestBase.cs

@ -5,6 +5,7 @@
namespace ImageProcessorCore.Tests
{
using System.IO;
using System.Collections.Generic;
/// <summary>
@ -34,5 +35,17 @@ namespace ImageProcessorCore.Tests
new TestFile(TestImages.Gif.Rings),
//new TestFile(TestImages.Gif.Giphy) // Perf: Enable for local testing only
};
protected string CreateOutputDirectory(string path)
{
path = "TestOutput/" + path;
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
return path;
}
}
}

6
tests/ImageProcessorCore.Tests/Formats/Bmp/BitmapTests.cs

@ -24,11 +24,7 @@ namespace ImageProcessorCore.Tests
[MemberData("BitsPerPixel")]
public void BitmapCanEncodeDifferentBitRates(BmpBitsPerPixel bitsPerPixel)
{
const string path = "TestOutput/Bmp";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Bmp");
foreach (TestFile file in Files)
{

36
tests/ImageProcessorCore.Tests/Formats/GeneralFormatTests.cs

@ -15,11 +15,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ResolutionShouldChange()
{
const string path = "TestOutput/Resolution";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resolution");
foreach (TestFile file in Files)
{
@ -37,11 +33,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageCanEncodeToString()
{
const string path = "TestOutput/ToString";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("ToString");
foreach (TestFile file in Files)
{
@ -55,11 +47,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void DecodeThenEncodeImageFromStreamShouldSucceed()
{
const string path = "TestOutput/Encode";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Encode");
foreach (TestFile file in Files)
{
@ -75,11 +63,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void QuantizeImageShouldPreserveMaximumColorPrecision()
{
const string path = "TestOutput/Quantize";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Quantize");
foreach (TestFile file in Files)
{
@ -115,11 +99,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageCanConvertFormat()
{
const string path = "TestOutput/Format";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Format");
foreach (TestFile file in Files)
{
@ -150,11 +130,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldPreservePixelByteOrderWhenSerialized()
{
const string path = "TestOutput/Serialized";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Serialized");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Formats/Png/PngTests.cs

@ -16,11 +16,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageCanSaveIndexedPng()
{
const string path = "TestOutput/Png";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Png");
foreach (TestFile file in Files)
{

12
tests/ImageProcessorCore.Tests/Processors/Filters/AlphaTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("AlphaValues")]
public void ImageShouldApplyAlphaFilter(int value)
{
const string path = "TestOutput/Alpha";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Alpha");
foreach (TestFile file in Files)
{
@ -45,11 +41,7 @@ namespace ImageProcessorCore.Tests
[MemberData("AlphaValues")]
public void ImageShouldApplyAlphaFilterInBox(int value)
{
const string path = "TestOutput/Alpha";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Alpha");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/BackgroundColorTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyBackgroundColorFilter()
{
const string path = "TestOutput/BackgroundColor";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("BackgroundColor");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/BinaryThreshold.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("BinaryThresholdValues")]
public void ImageShouldApplyBinaryThresholdFilter(float value)
{
const string path = "TestOutput/BinaryThreshold";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("BinaryThreshold");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/BlackWhiteTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyBlackWhiteFilter()
{
const string path = "TestOutput/BlackWhite";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("BlackWhite");
foreach (TestFile file in Files)
{

8
tests/ImageProcessorCore.Tests/Processors/Filters/BlendTest.cs

@ -14,14 +14,10 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyBlendFilter()
{
const string path = "TestOutput/Blend";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Blend");
Image blend;
using (FileStream stream = File.OpenRead("TestImages/Formats/Bmp/Car.bmp"))
using (FileStream stream = File.OpenRead(TestImages.Bmp.Car))
{
blend = new Image(stream);
}

6
tests/ImageProcessorCore.Tests/Processors/Filters/BoxBlurTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("BoxBlurValues")]
public void ImageShouldApplyBoxBlurFilter(int value)
{
const string path = "TestOutput/BoxBlur";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("BoxBlur");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/BrightnessTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("BrightnessValues")]
public void ImageShouldApplyBrightnessFilter(int value)
{
const string path = "TestOutput/Brightness";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Brightness");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/ColorBlindnessTest.cs

@ -28,11 +28,7 @@ namespace ImageProcessorCore.Tests
[MemberData("ColorBlindnessFilters")]
public void ImageShouldApplyColorBlindnessFilter(ColorBlindness colorBlindness)
{
const string path = "TestOutput/ColorBlindness";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("ColorBlindness");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/ContrastTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("ContrastValues")]
public void ImageShouldApplyContrastFilter(int value)
{
const string path = "TestOutput/Contrast";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Contrast");
foreach (TestFile file in Files)
{

24
tests/ImageProcessorCore.Tests/Processors/Filters/GlowTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyGlowFilter()
{
const string path = "TestOutput/Glow";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Glow");
foreach (TestFile file in Files)
{
@ -35,11 +31,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyGlowFilterColor()
{
const string path = "TestOutput/Glow";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Glow");
foreach (TestFile file in Files)
{
@ -57,11 +49,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyGlowFilterRadius()
{
const string path = "TestOutput/Glow";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Glow");
foreach (TestFile file in Files)
{
@ -79,11 +67,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyGlowFilterInBox()
{
const string path = "TestOutput/Glow";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Glow");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/GrayscaleTest.cs

@ -23,11 +23,7 @@ namespace ImageProcessorCore.Tests
[MemberData("GrayscaleValues")]
public void ImageShouldApplyGrayscaleFilter(GrayscaleMode value)
{
const string path = "TestOutput/Grayscale";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Grayscale");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/HueTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("HueValues")]
public void ImageShouldApplyHueFilter(int value)
{
const string path = "TestOutput/Hue";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Hue");
foreach (TestFile file in Files)
{

13
tests/ImageProcessorCore.Tests/Processors/Filters/InvertTest.cs

@ -14,12 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyInvertFilter()
{
const string path = "TestOutput/Invert";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Invert");
foreach (TestFile file in Files)
{
Image image = file.CreateImage();
@ -35,11 +30,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyInvertFilterInBox()
{
const string path = "TestOutput/Invert";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Invert");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/KodachromeTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyKodachromeFilter()
{
const string path = "TestOutput/Kodachrome";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Kodachrome");
foreach (TestFile file in Files)
{

13
tests/ImageProcessorCore.Tests/Processors/Filters/LomographTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyLomographFilter()
{
const string path = "TestOutput/Lomograph";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Lomograph");
foreach (TestFile file in Files)
{
@ -35,11 +31,8 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyLomographFilterInBox()
{
const string path = "TestOutput/Lomograph";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Lomograph");
foreach (TestFile file in Files)
{
string filename = file.GetFileName("InBox");

6
tests/ImageProcessorCore.Tests/Processors/Filters/PolaroidTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyPolaroidFilter()
{
const string path = "TestOutput/Polaroid";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Polaroid");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/SaturationTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("SaturationValues")]
public void ImageShouldApplySaturationFilter(int value)
{
const string path = "TestOutput/Saturation";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Saturation");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Filters/SepiaTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplySepiaFilter()
{
const string path = "TestOutput/Sepia";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Sepia");
foreach (TestFile file in Files)
{

24
tests/ImageProcessorCore.Tests/Processors/Filters/VignetteTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyVignetteFilter()
{
const string path = "TestOutput/Vignette";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Vignette");
foreach (TestFile file in Files)
{
@ -35,11 +31,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyVignetteFilterColor()
{
const string path = "TestOutput/Vignette";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Vignette");
foreach (TestFile file in Files)
{
@ -57,11 +49,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyVignetteFilterRadius()
{
const string path = "TestOutput/Vignette";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Vignette");
foreach (TestFile file in Files)
{
@ -79,11 +67,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyVignetteFilterInBox()
{
const string path = "TestOutput/Vignette";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Vignette");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Samplers/AutoOrientTests.cs

@ -28,11 +28,7 @@ namespace ImageProcessorCore.Tests
[MemberData("OrientationValues")]
public void ImageShouldFlip(RotateType rotateType, FlipType flipType, ushort orientation)
{
const string path = "TestOutput/AutoOrient";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("AutoOrient");
string file = TestImages.Bmp.F;

6
tests/ImageProcessorCore.Tests/Processors/Samplers/CropTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyCropSampler()
{
const string path = "TestOutput/Crop";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Crop");
foreach (TestFile file in Files)
{

12
tests/ImageProcessorCore.Tests/Processors/Samplers/DetectEdgesTest.cs

@ -30,11 +30,7 @@ namespace ImageProcessorCore.Tests
[MemberData(nameof(DetectEdgesFilters))]
public void ImageShouldApplyDetectEdgesFilter(EdgeDetection detector)
{
const string path = "TestOutput/DetectEdges";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("DetectEdges");
foreach (TestFile file in Files)
{
@ -53,11 +49,7 @@ namespace ImageProcessorCore.Tests
[MemberData("DetectEdgesFilters")]
public void ImageShouldApplyDetectEdgesFilterInBox(EdgeDetection detector)
{
const string path = "TestOutput/DetectEdges";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("DetectEdges");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Samplers/EntropyCropTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("EntropyCropValues")]
public void ImageShouldApplyEntropyCropSampler(float value)
{
const string path = "TestOutput/EntropyCrop";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("EntropyCrop");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Samplers/FlipTests.cs

@ -23,11 +23,7 @@ namespace ImageProcessorCore.Tests
[MemberData("FlipValues")]
public void ImageShouldFlip(FlipType flipType)
{
const string path = "TestOutput/Flip";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Flip");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Samplers/GuassianBlurTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("GuassianBlurValues")]
public void ImageShouldApplyGuassianBlurFilter(int value)
{
const string path = "TestOutput/GuassianBlur";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("GuassianBlur");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Samplers/GuassianSharpenTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("GuassianSharpenValues")]
public void ImageShouldApplyGuassianSharpenFilter(int value)
{
const string path = "TestOutput/GuassianSharpen";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("GuassianSharpen");
foreach (TestFile file in Files)
{

12
tests/ImageProcessorCore.Tests/Processors/Samplers/OilPaintTest.cs

@ -23,11 +23,7 @@ namespace ImageProcessorCore.Tests
[MemberData(nameof(OilPaintValues))]
public void ImageShouldApplyOilPaintFilter(Tuple<int, int> value)
{
const string path = "TestOutput/OilPaint";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("OilPaint");
foreach (TestFile file in Files)
{
@ -46,11 +42,7 @@ namespace ImageProcessorCore.Tests
[MemberData(nameof(OilPaintValues))]
public void ImageShouldApplyOilPaintFilterInBox(Tuple<int, int> value)
{
const string path = "TestOutput/OilPaint";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("OilPaint");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Samplers/PadTest.cs

@ -14,11 +14,7 @@ namespace ImageProcessorCore.Tests
[Fact]
public void ImageShouldApplyPadSampler()
{
const string path = "TestOutput/Pad";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Pad");
foreach (TestFile file in Files)
{

12
tests/ImageProcessorCore.Tests/Processors/Samplers/PixelateTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData(nameof(PixelateValues))]
public void ImageShouldApplyPixelateFilter(int value)
{
const string path = "TestOutput/Pixelate";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Pixelate");
foreach (TestFile file in Files)
{
@ -45,11 +41,7 @@ namespace ImageProcessorCore.Tests
[MemberData(nameof(PixelateValues))]
public void ImageShouldApplyPixelateFilterInBox(int value)
{
const string path = "TestOutput/Pixelate";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Pixelate");
foreach (TestFile file in Files)
{

52
tests/ImageProcessorCore.Tests/Processors/Samplers/ResizeTests.cs

@ -11,8 +11,6 @@ namespace ImageProcessorCore.Tests
public class ResizeTests : FileTestBase
{
private const string path = "TestOutput/Resize";
public static readonly TheoryData<string, IResampler> ReSamplers =
new TheoryData<string, IResampler>
{
@ -37,10 +35,7 @@ namespace ImageProcessorCore.Tests
[MemberData("ReSamplers")]
public void ImageShouldResize(string name, IResampler sampler)
{
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{
@ -62,10 +57,7 @@ namespace ImageProcessorCore.Tests
{
name = name + "-FixedWidth";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{
@ -86,10 +78,7 @@ namespace ImageProcessorCore.Tests
{
name = name + "-FixedHeight";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{
@ -110,10 +99,7 @@ namespace ImageProcessorCore.Tests
{
name = name + "-CropWidth";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{
@ -140,10 +126,7 @@ namespace ImageProcessorCore.Tests
{
name = name + "-CropHeight";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{
@ -170,10 +153,7 @@ namespace ImageProcessorCore.Tests
{
name = name + "-Pad";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{
@ -200,10 +180,7 @@ namespace ImageProcessorCore.Tests
{
name = name + "-BoxPad";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{
@ -231,10 +208,7 @@ namespace ImageProcessorCore.Tests
{
name = name + "Max";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{
@ -262,10 +236,7 @@ namespace ImageProcessorCore.Tests
{
name = name + "-Min";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{
@ -293,10 +264,7 @@ namespace ImageProcessorCore.Tests
{
name = name + "Stretch";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Resize");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Samplers/RotateFlipTest.cs

@ -25,11 +25,7 @@ namespace ImageProcessorCore.Tests
[MemberData("RotateFlipValues")]
public void ImageShouldRotateFlip(RotateType rotateType, FlipType flipType)
{
const string path = "TestOutput/RotateFlip";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("RotateFlip");
foreach (TestFile file in Files)
{

12
tests/ImageProcessorCore.Tests/Processors/Samplers/RotateTest.cs

@ -31,11 +31,7 @@ namespace ImageProcessorCore.Tests
[MemberData("RotateFloatValues")]
public void ImageShouldApplyRotateSampler(float value)
{
const string path = "TestOutput/Rotate";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Rotate");
foreach (TestFile file in Files)
{
@ -54,11 +50,7 @@ namespace ImageProcessorCore.Tests
[MemberData("RotateEnumValues")]
public void ImageShouldApplyRotateSampler(RotateType value)
{
const string path = "TestOutput/Rotate";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Rotate");
foreach (TestFile file in Files)
{

6
tests/ImageProcessorCore.Tests/Processors/Samplers/SkewTest.cs

@ -22,11 +22,7 @@ namespace ImageProcessorCore.Tests
[MemberData("SkewValues")]
public void ImageShouldApplySkewSampler(float x, float y)
{
const string path = "TestOutput/Skew";
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
string path = CreateOutputDirectory("Skew");
// Matches live example
// http://www.w3schools.com/css/tryit.asp?filename=trycss3_transform_skew

Loading…
Cancel
Save