Browse Source

Begin general tests

af/merge-core
James Jackson-South 9 years ago
parent
commit
45d2fe6ed7
  1. 22
      tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs

22
tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs

@ -13,22 +13,16 @@ namespace ImageSharp.Tests
public class GeneralFormatTests : FileTestBase public class GeneralFormatTests : FileTestBase
{ {
[Fact] [Theory]
public void ResolutionShouldChange() [WithFileCollection(nameof(DefaultFiles), StandardPixelType)]
public void ResolutionShouldChange<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{ {
string path = this.CreateOutputDirectory("Resolution"); using (Image<TPixel> image = provider.GetImage())
foreach (TestFile file in Files)
{ {
using (Image<Rgba32> image = file.CreateImage()) image.MetaData.VerticalResolution = 150;
{ image.MetaData.HorizontalResolution = 150;
using (FileStream output = File.OpenWrite($"{path}/{file.FileName}")) image.DebugSave(provider, null, Extensions.Bmp);
{
image.MetaData.VerticalResolution = 150;
image.MetaData.HorizontalResolution = 150;
image.Save(output);
}
}
} }
} }

Loading…
Cancel
Save