diff --git a/tests/ImageProcessorCore.Tests/Processors/Samplers/FlipTests.cs b/tests/ImageProcessorCore.Tests/Processors/Samplers/FlipTests.cs
new file mode 100644
index 000000000..5402644e5
--- /dev/null
+++ b/tests/ImageProcessorCore.Tests/Processors/Samplers/FlipTests.cs
@@ -0,0 +1,48 @@
+//
+// Copyright (c) James Jackson-South and contributors.
+// Licensed under the Apache License, Version 2.0.
+//
+
+namespace ImageProcessorCore.Tests
+{
+ using System.IO;
+
+ using Xunit;
+
+ public class FlipTest : FileTestBase
+ {
+ public static readonly TheoryData FlipValues
+ = new TheoryData
+ {
+ { FlipType.None },
+ { FlipType.Vertical },
+ { FlipType.Horizontal },
+ };
+
+ [Theory]
+ [MemberData("FlipValues")]
+ public void ImageShouldFlip(FlipType flipType)
+ {
+ const string path = "TestOutput/Flip";
+ if (!Directory.Exists(path))
+ {
+ Directory.CreateDirectory(path);
+ }
+
+ foreach (string file in Files)
+ {
+ using (FileStream stream = File.OpenRead(file))
+ {
+ string filename = Path.GetFileNameWithoutExtension(file) + "-" + flipType + Path.GetExtension(file);
+
+ Image image = new Image(stream);
+ using (FileStream output = File.OpenWrite($"{path}/{filename}"))
+ {
+ image.Flip(flipType, this.ProgressUpdate)
+ .Save(output);
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/ImageProcessorCore.Tests/Processors/Samplers/RotateTest.cs b/tests/ImageProcessorCore.Tests/Processors/Samplers/RotateTest.cs
index 7b38656b1..61ffdfd93 100644
--- a/tests/ImageProcessorCore.Tests/Processors/Samplers/RotateTest.cs
+++ b/tests/ImageProcessorCore.Tests/Processors/Samplers/RotateTest.cs
@@ -11,15 +11,25 @@ namespace ImageProcessorCore.Tests
public class RotateTest : FileTestBase
{
- public static readonly TheoryData RotateValues
- = new TheoryData
+ public static readonly TheoryData RotateFloatValues
+ = new TheoryData
{
170 ,
-170 ,
+ 90 ,
+ };
+
+ public static readonly TheoryData RotateEnumValues
+ = new TheoryData
+ {
+ RotateType.None,
+ RotateType.Rotate90,
+ RotateType.Rotate180,
+ RotateType.Rotate270
};
[Theory]
- [MemberData("RotateValues")]
+ [MemberData("RotateFloatValues")]
public void ImageShouldApplyRotateSampler(float value)
{
const string path = "TestOutput/Rotate";
@@ -43,5 +53,31 @@ namespace ImageProcessorCore.Tests
}
}
}
+
+ [Theory]
+ [MemberData("RotateEnumValues")]
+ public void ImageShouldApplyRotateSampler(RotateType value)
+ {
+ const string path = "TestOutput/Rotate";
+ if (!Directory.Exists(path))
+ {
+ Directory.CreateDirectory(path);
+ }
+
+ foreach (string file in Files)
+ {
+ using (FileStream stream = File.OpenRead(file))
+ {
+ string filename = Path.GetFileNameWithoutExtension(file) + "-" + value + Path.GetExtension(file);
+
+ Image image = new Image(stream);
+ using (FileStream output = File.OpenWrite($"{path}/{filename}"))
+ {
+ image.Rotate(value)
+ .Save(output);
+ }
+ }
+ }
+ }
}
}
\ No newline at end of file