/* ----------------------------------------------------------------- */
///
/// AssertRun
///
/// <summary>
/// Converter クラスの実行をチェックします。
/// </summary>
///
/* ----------------------------------------------------------------- */
private void AssertRun(UserSetting setting, string suffix)
{
var basename = IoEx.Path.GetFileNameWithoutExtension(setting.InputPath);
var extension = Parameter.GetExtension((Parameter.FileTypes)setting.FileType);
setting.LibPath = IoEx.Path.Combine(_root, "Ghostscript");
setting.OutputPath = IoEx.Path.Combine(_results, basename + suffix + extension);
if (setting.ExistedFile == Parameter.ExistedFiles.Overwrite)
{
IoEx.File.Delete(setting.OutputPath);
}
var converter = new Converter();
converter.Run(setting);
var error = GetErrorMessage(converter);
Assert.IsTrue(string.IsNullOrEmpty(error), string.Format("{0}:{1}", setting.InputPath, error));
if (!IoEx.File.Exists(setting.OutputPath))
{
var dest = String.Format("{0}\\{1}-001{2}",
IoEx.Path.GetDirectoryName(setting.OutputPath),
IoEx.Path.GetFileNameWithoutExtension(setting.OutputPath),
IoEx.Path.GetExtension(setting.OutputPath)
);
Assert.IsTrue(IoEx.File.Exists(dest), setting.OutputPath);
}
else if (setting.FileType == Parameter.FileTypes.PDF)
{
AssertPdf(setting);
}
}