From 51350d869028c6ad617db51683325f55c62ea760 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Tue, 30 May 2017 17:28:18 +1000 Subject: [PATCH] Flip --- .../Processing/Transforms/FlipTests.cs | 37 ++++++++++++++++ .../Processors/Filters/FlipTests.cs | 42 ------------------- 2 files changed, 37 insertions(+), 42 deletions(-) create mode 100644 tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs delete mode 100644 tests/ImageSharp.Tests/Processors/Filters/FlipTests.cs diff --git a/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs new file mode 100644 index 0000000000..e002ebc706 --- /dev/null +++ b/tests/ImageSharp.Tests/Processing/Transforms/FlipTests.cs @@ -0,0 +1,37 @@ +// +// Copyright (c) James Jackson-South and contributors. +// Licensed under the Apache License, Version 2.0. +// + +namespace ImageSharp.Tests.Processing.Transforms +{ + using ImageSharp.PixelFormats; + using ImageSharp.Processing; + + using Xunit; + + public class FlipTests : FileTestBase + { + public static readonly string[] FlipFiles = { TestImages.Bmp.F }; + + public static readonly TheoryData FlipValues + = new TheoryData + { + { FlipType.None }, + { FlipType.Vertical }, + { FlipType.Horizontal }, + }; + + [Theory] + [WithFileCollection(nameof(FlipFiles), nameof(FlipValues), StandardPixelType)] + public void ImageShouldFlip(TestImageProvider provider, FlipType flipType) + where TPixel : struct, IPixel + { + using (Image image = provider.GetImage()) + { + image.Flip(flipType) + .DebugSave(provider, flipType, Extensions.Bmp); + } + } + } +} \ No newline at end of file diff --git a/tests/ImageSharp.Tests/Processors/Filters/FlipTests.cs b/tests/ImageSharp.Tests/Processors/Filters/FlipTests.cs deleted file mode 100644 index c10eac4300..0000000000 --- a/tests/ImageSharp.Tests/Processors/Filters/FlipTests.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// Copyright (c) James Jackson-South and contributors. -// Licensed under the Apache License, Version 2.0. -// - -namespace ImageSharp.Tests -{ - using System.IO; - - using ImageSharp.PixelFormats; - - using ImageSharp.Processing; - using Xunit; - - public class FlipTests : FileTestBase - { - public static readonly TheoryData FlipValues - = new TheoryData - { - { FlipType.None }, - { FlipType.Vertical }, - { FlipType.Horizontal }, - }; - - [Theory] - [MemberData(nameof(FlipValues))] - public void ImageShouldFlip(FlipType flipType) - { - string path = this.CreateOutputDirectory("Flip"); - - foreach (TestFile file in Files) - { - string filename = file.GetFileName(flipType); - using (Image image = file.CreateImage()) - using (FileStream output = File.OpenWrite($"{path}/{filename}")) - { - image.Flip(flipType).Save(output); - } - } - } - } -} \ No newline at end of file