public void GetNegativeQuality() { var expected = new GifFormat(); var i = new Imaging(); foreach (var extension in expected.FileExtensions) { var format = i.Get(extension, -45); Assert.AreEqual(Imaging.DefaultImageQuality, format.Quality); } }
private ISupportedImageFormat GetFormat(string extension, ImageInstruction ins) { ISupportedImageFormat format = null; if (extension.Equals(".jpg", StringComparison.OrdinalIgnoreCase) || extension.Equals(".jpeg", StringComparison.OrdinalIgnoreCase)) format = new JpegFormat { Quality = ins.JpegQuality }; else if (extension.Equals(".gif", StringComparison.OrdinalIgnoreCase)) format = new GifFormat { }; else if (extension.Equals(".png", StringComparison.OrdinalIgnoreCase)) format = new PngFormat { }; return format; }
public void GetGif() { var expected = new GifFormat(); var i = new Imaging(); foreach (var extension in expected.FileExtensions) { var format = i.Get(extension); Assert.AreEqual(expected.GetType(), format.GetType()); } }