Browse Source

Adds test for constraints resize

Former-commit-id: a30d4df7acc83a74eab1ed881a010fe14b42dd1f
af/merge-core
Thomas Broust 12 years ago
parent
commit
03c19e3ae2
  1. 24
      src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs
  2. 4
      src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj

24
src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs

@ -21,11 +21,6 @@ namespace ImageProcessor.UnitTests
[TestFixture]
public class ImageFactoryUnitTests
{
/// <summary>
/// The path to the binary's folder
/// </summary>
private readonly string localPath = Path.GetDirectoryName(new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath);
/// <summary>
/// Lists the input files in the Images folder
/// </summary>
@ -112,5 +107,24 @@ namespace ImageProcessor.UnitTests
}
}
}
/// <summary>
/// Tests that the image is well resized using constraints
/// </summary>
[Test]
public void ApplyConstraints()
{
foreach (var fileName in ListInputFiles())
{
using (var imageFactory = new ImageFactory())
{
imageFactory.Load(fileName);
var original = imageFactory.Image.Clone();
imageFactory.Constrain(new System.Drawing.Size(200, 200));
var modified = imageFactory.Image.Clone();
Assert.AreNotEqual(original, modified);
}
}
}
}
}

4
src/ImageProcessor.UnitTests/ImageProcessor.UnitTests.csproj

@ -82,10 +82,6 @@
<Link>Images\Lighthouse.jpg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Images\Penguins-200.jpg">
<Link>Images\Penguins-200.jpg</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Images\Penguins-8.png">
<Link>Images\Penguins-8.png</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

Loading…
Cancel
Save