mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-15 01:25:40 -05:00
* Allow multiple backups per backup service instance * Add test to run multiple backups * Update backup cancelTask method signature * Fix to have multiple backup instances and add more tests * Address PR comments * Remove double new lines * Add Azure check for backup operations
63 lines
1.7 KiB
C#
63 lines
1.7 KiB
C#
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
//
|
|
|
|
using Microsoft.SqlServer.Management.Smo;
|
|
using Microsoft.SqlTools.ServiceLayer.Admin;
|
|
using Microsoft.SqlTools.ServiceLayer.DisasterRecovery;
|
|
using Microsoft.SqlTools.ServiceLayer.DisasterRecovery.Contracts;
|
|
using System.Data.SqlClient;
|
|
using System.Threading;
|
|
|
|
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.DisasterRecovery
|
|
{
|
|
/// <summary>
|
|
/// Stub class that implements IBackupOperation
|
|
/// </summary>
|
|
public class BackupOperationStub : IBackupOperation
|
|
{
|
|
/// <summary>
|
|
/// Initialize
|
|
/// </summary>
|
|
/// <param name="dataContainer"></param>
|
|
/// <param name="sqlConnection"></param>
|
|
public void Initialize(CDataContainer dataContainer, SqlConnection sqlConnection)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Return database metadata for backup
|
|
/// </summary>
|
|
/// <param name="databaseName"></param>
|
|
/// <returns></returns>
|
|
public BackupConfigInfo GetBackupConfigInfo(string databaseName)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Set backup input properties
|
|
/// </summary>
|
|
/// <param name="input"></param>
|
|
public void SetBackupInput(BackupInfo input)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Execute backup
|
|
/// </summary>
|
|
public void PerformBackup()
|
|
{
|
|
Thread.Sleep(500);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Cancel backup
|
|
/// </summary>
|
|
public void CancelBackup()
|
|
{
|
|
}
|
|
}
|
|
}
|