Пример #1
0
        public void TestOnBackupCompletedJScript()
        {
            Scripting scripting = _settings.Scripting;
             scripting.Language = "JScript";

             // First set up a script
             string script =
            @"function OnBackupCompleted()
                           {
                               EventLog.Write('Backup process completed')
                           }";

             string file = scripting.CurrentScriptFile;
             File.WriteAllText(file, script);
             scripting.Enabled = true;
             scripting.Reload();

             var back = new BackupRestore();
             back.InitializeBackupSettings();
             back.TestWithMessages();

             string eventLogText = TestSetup.ReadExistingTextFile(LogHandler.GetEventLogFileName());
             Assert.IsTrue(eventLogText.Contains("Backup process completed"));
        }
Пример #2
0
        public void TestOnBackupCompletedVBScript()
        {
            // First set up a script
             string script =
            @"Sub OnBackupCompleted()
                               EventLog.Write(""Backup process completed"")
                           End Sub";

             Scripting scripting = _settings.Scripting;
             string file = scripting.CurrentScriptFile;
             TestSetup.WriteFile(file, script);
             scripting.Enabled = true;
             scripting.Reload();

             var back = new BackupRestore();
             back.InitializeBackupSettings();
             back.TestWithMessages();

             string eventLogText = TestSetup.ReadExistingTextFile(TestSetup.GetEventLogFileName());
             CustomAssert.IsTrue(eventLogText.Contains("Backup process completed"));
        }