public virtual void ImageMagickEnvVarIsIncorrect() { NUnit.Framework.Assert.That(() => { ImageMagickHelper imageMagickHelper = new ImageMagickHelper("-"); } , NUnit.Framework.Throws.InstanceOf<ArgumentException>().With.Message.EqualTo(IoExceptionMessage.COMPARE_COMMAND_SPECIFIED_INCORRECTLY)) ; }
public virtual void RunImageMagickForEqualImages() { String inputImage = sourceFolder + "image.png"; String cmpImage = sourceFolder + "cmp_image.png"; String diff = destinationFolder + "diff_equalImages.png"; ImageMagickHelper imageMagickHelper = new ImageMagickHelper(); bool result = imageMagickHelper.RunImageMagickImageCompare(inputImage, cmpImage, diff); NUnit.Framework.Assert.IsTrue(result); NUnit.Framework.Assert.IsTrue(FileUtil.FileExists(diff)); }
public virtual void RunImageMagickForDifferentImagesWithFuzzParamEqual() { String inputImage = sourceFolder + "Im1_1.jpg"; String cmpImage = sourceFolder + "cmp_Im1_1.jpg"; String diff = destinationFolder + "diff_differentImagesFuzzEnough.png"; ImageMagickHelper imageMagickHelper = new ImageMagickHelper(); bool result = imageMagickHelper.RunImageMagickImageCompare(inputImage, cmpImage, diff, "1.2"); NUnit.Framework.Assert.IsTrue(result); NUnit.Framework.Assert.IsTrue(FileUtil.FileExists(diff)); }
public virtual void ImageMagickEnvVarIsExplicitlySpecified() { String compareExec = SystemUtil.GetEnvironmentVariable(ImageMagickHelper.MAGICK_COMPARE_ENVIRONMENT_VARIABLE ); if (compareExec == null) { compareExec = SystemUtil.GetEnvironmentVariable(ImageMagickHelper.MAGICK_COMPARE_ENVIRONMENT_VARIABLE_LEGACY ); } ImageMagickHelper imageMagickHelper = new ImageMagickHelper(compareExec); NUnit.Framework.Assert.IsNotNull(imageMagickHelper.GetCliExecutionCommand()); }
public virtual void GhostScriptImageGenerationTest() { String filename = "resultantImage.png"; String psFile = sourceFolder + "simple.ps"; String resultantImage = destinationFolder + filename; String cmpResultantImage = sourceFolder + "cmp_" + filename; String diff = destinationFolder + "diff_" + filename; GhostscriptHelper ghostscriptHelper = new GhostscriptHelper(); ghostscriptHelper.RunGhostScriptImageGeneration(psFile, destinationFolder, filename); NUnit.Framework.Assert.IsTrue(FileUtil.FileExists(resultantImage)); ImageMagickHelper imageMagickHelper = new ImageMagickHelper(); NUnit.Framework.Assert.IsTrue(imageMagickHelper.RunImageMagickImageCompare(resultantImage, cmpResultantImage , diff)); }
public virtual void ImageMagickEnvVarIsDefault() { ImageMagickHelper imageMagickHelper = new ImageMagickHelper(); NUnit.Framework.Assert.IsNotNull(imageMagickHelper.GetCliExecutionCommand()); }