public void TestListBackups()
    {
        ListBackupsSample getBackupsSample = new ListBackupsSample();
        var backups = getBackupsSample.ListBackups(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.BackupDatabaseId, _spannerFixture.BackupId);

        Assert.Contains(backups, b => b.BackupName.BackupId == _spannerFixture.BackupId);
    }
Exemplo n.º 2
0
    public void TestUpdateBackup()
    {
        UpdateBackupSample updateBackupSample = new UpdateBackupSample();
        ListBackupsSample  getBackupsSample   = new ListBackupsSample();
        var backups       = getBackupsSample.ListBackups(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.DatabaseId, _spannerFixture.BackupId).ToList();
        var updatedBackup = updateBackupSample.UpdateBackup(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.BackupId);
        var backup        = backups.FirstOrDefault(c => c.BackupName.BackupId == _spannerFixture.BackupId);

        Assert.NotEqual(backup.ExpireTime, updatedBackup.ExpireTime);
    }
Exemplo n.º 3
0
    public void TestCancelBackupOperation()
    {
        CancelBackupOperationSample cancelBackupOperationSample = new CancelBackupOperationSample();
        ListBackupsSample           listBackupsSample           = new ListBackupsSample();

        cancelBackupOperationSample.CancelBackupOperation(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.DatabaseId, _spannerFixture.ToBeCancelledBackupId);
        var backups = listBackupsSample.ListBackups(_spannerFixture.ProjectId, _spannerFixture.InstanceId, _spannerFixture.DatabaseId, _spannerFixture.ToBeCancelledBackupId);

        Assert.DoesNotContain(backups, b => b.BackupName.BackupId == _spannerFixture.ToBeCancelledBackupId);
    }