public void ScriptSettings_NoScriptFile()
        {
            _profile.Scripting.Enabled    = true;
            _profile.Scripting.ScriptFile = "";

            var result = _scriptAction.Check(_profile, new Accounts());

            Assert.Contains(ErrorCode.Script_NoScriptFileSpecified, result, "did not detect missing script file.");
            result.Remove(ErrorCode.Script_NoScriptFileSpecified);
            Assert.IsTrue(result, "Unexpected errorcodes:" + Environment.NewLine + result);
        }
Beispiel #2
0
        public static ActionResult ProfileCheck(ConversionProfile profile)
        {
            var actionResult = new ActionResult();

            actionResult.AddRange(CheckAutosaveSettings(profile));
            actionResult.AddRange(CheckSaveSettings(profile));
            actionResult.AddRange(CheckCoverPageSettings(profile));
            actionResult.AddRange(CheckAttachmentPageSettings(profile));
            actionResult.AddRange(CheckStampingSettings(profile));
            actionResult.AddRange(CheckEncryptionSettings(profile));
            actionResult.AddRange(CheckBackgroundpageSettings(profile));
            actionResult.AddRange(CheckSignatureSettings(profile));

            var ftpAction = new FtpAction();

            actionResult.AddRange(ftpAction.Check(profile));
            var scriptAction = new ScriptAction();

            actionResult.AddRange(scriptAction.Check(profile));
            var smtpMailAction = new SmtpMailAction("");

            actionResult.AddRange(smtpMailAction.Check(profile));

            return(actionResult);
        }
Beispiel #3
0
        public void Check_WithDisabledScriptingAndIllegalPath_ReturnsTrue()
        {
            var scriptAction = new ScriptAction();
            var profile      = new ConversionProfile();

            profile.Scripting.Enabled    = false;
            profile.Scripting.ScriptFile = ">test.exe";

            var result = scriptAction.Check(profile);

            Assert.IsTrue(result);
        }
Beispiel #4
0
        public void Check_WithTokenInPath_AllowsPath()
        {
            var scriptAction = new ScriptAction();
            var profile      = new ConversionProfile();

            profile.Scripting.Enabled    = true;
            profile.Scripting.ScriptFile = "<Environment:TMP>\\unique_file_name-3453454353453453462.exe";

            ActionResult result = scriptAction.Check(profile);

            // ignore File not found error code
            result.RemoveAll(x => x == 14101);

            Assert.IsTrue(result);
        }
Beispiel #5
0
        public void Check_ValidScriptSettings_ResultIsTrue()
        {
            _profile.Scripting.Enabled    = true;
            _profile.Scripting.ScriptFile = "ScriptfileDummy.exe";

            var result = _scriptAction.Check(_profile, _unusedAccounts, CheckLevel.Profile);

            Assert.IsTrue(result, "Unexpected errorcodes:" + Environment.NewLine + result);
        }