Browse Source

Checks that the image is actually resized

Former-commit-id: cf8a8931b6b28c4825283f3a6af4e8c4d087ca9e
af/merge-core
Thomas Broust 12 years ago
parent
commit
12e8fbca6c
  1. 14
      src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs

14
src/ImageProcessor.UnitTests/ImageFactoryUnitTests.cs

@ -83,8 +83,7 @@ namespace ImageProcessor.UnitTests
imageFactory.Load(fileName);
var original = imageFactory.Image.Clone();
imageFactory.Alpha(50);
var modified = imageFactory.Image.Clone();
Assert.AreNotEqual(original, modified);
Assert.AreNotEqual(original, imageFactory.Image);
}
}
}
@ -102,8 +101,7 @@ namespace ImageProcessor.UnitTests
imageFactory.Load(fileName);
var original = imageFactory.Image.Clone();
imageFactory.Brightness(50);
var modified = imageFactory.Image.Clone();
Assert.AreNotEqual(original, modified);
Assert.AreNotEqual(original, imageFactory.Image);
}
}
}
@ -114,15 +112,17 @@ namespace ImageProcessor.UnitTests
[Test]
public void ApplyConstraints()
{
const int maxSize = 200;
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);
imageFactory.Constrain(new System.Drawing.Size(maxSize, maxSize));
Assert.AreNotEqual(original, imageFactory.Image);
Assert.LessOrEqual(maxSize, imageFactory.Image.Width);
Assert.LessOrEqual(maxSize, imageFactory.Image.Height);
}
}
}

Loading…
Cancel
Save