예제 #1
0
        public void Execute_NoManifest()
        {
            bool success = _task.Execute();

            Assert.IsTrue(success);
            Assert.AreEqual(1, _buildEngine.Warnings.Count);
            Assert.AreEqual(0, _buildEngine.Messages.Count);
            Assert.AreEqual(1, _task.ProviderAssemblies.Length);
            Assert.IsNull(_task.FilesWritten);
        }
예제 #2
0
        private static void ExecuteRestore(DatabaseRestoreTargetConfigurationElement target)
        {
            try
            {
                RestoreTask task = new RestoreTask(target);
                task.DecompressComplete += new EventHandler <RestoreDatabaseTargetEventArgs>(RestoreDecompressComplete);
                task.DecompressStart    += new EventHandler <RestoreDatabaseTargetEventArgs>(RestoreDecompressStart);
                task.RestoreComplete    += new EventHandler <RestoreDatabaseTargetEventArgs>(RestoreComplete);
                task.RestoreStart       += new EventHandler <RestoreDatabaseTargetEventArgs>(RestoreStart);
                task.TransferComplete   += new EventHandler <RestoreDatabaseTargetEventArgs>(RestoreTransferComplete);
                task.TransferProgress   += new EventHandler <RestoreDatabaseTargetEventArgs>(RestoreTransferProgress);
                task.TransferStart      += new EventHandler <RestoreDatabaseTargetEventArgs>(RestoreTransferStart);

                var result = task.Execute();

                if (!result.Success)
                {
                    WriteError(result.Exception);
                }
            }
            catch (Exception ex)
            {
                WriteError(ex);
            }
        }
예제 #3
0
        private static void ExecuteRestore(DatabaseRestoreTargetConfigurationElement target)
        {
            try
            {
                RestoreTask task = new RestoreTask(target);
                task.DecompressComplete += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreDecompressComplete);
                task.DecompressStart += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreDecompressStart);
                task.RestoreComplete += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreComplete);
                task.RestoreStart += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreStart);
                task.TransferComplete += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreTransferComplete);
                task.TransferProgress += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreTransferProgress);
                task.TransferStart += new EventHandler<RestoreDatabaseTargetEventArgs>(RestoreTransferStart);

                var result = task.Execute();

                if (!result.Success)
                {
                    WriteError(result.Exception);
                }
            }
            catch (Exception ex)
            {
                WriteError(ex);
            }
        }