コード例 #1
0
        public void TestCopy()
        {
            CopyAzureTables    instanceCopy    = new CopyAzureTables(AzureStorageConfigConnection);
            DeleteAzureTables  instanceDelete  = new DeleteAzureTables(AzureStorageConfigConnection);
            RestoreAzureTables instanceRestore = new RestoreAzureTables(AzureStorageConfigConnection);

            string deleteInitializeResult  = instanceDelete.DeleteAzureTableRows(TableNameTo);
            string deleteInitialize2Result = instanceDelete.DeleteAzureTableRows(TableNameTo2);
            string deleteInitialize3Result = instanceDelete.DeleteAzureTableRows(TableNameFrom);

            string restoreResult = instanceRestore.RestoreTableFromFile(TableNameFrom, FileNamePathThatExists_SystemLogs);
            int    RestoreCount  = ExtractNextInt(restoreResult, "Successful;", "entries");

            string copySetup = instanceCopy.CopyTableToTable(TableNameFrom, TableNameTo);
            //pull result of rows copied    "Table 'SystemLogs' copied to table 'TestCopy', total records 370."
            int InitialRowCount = ExtractNextInt(copySetup, "total records");

            List <Filter> Filters = new List <Filter>();

            Filters.Add(new Filter("PartitionKey", "=", "SecurityLog"));

            string delete2Result    = instanceDelete.DeleteAzureTableRows(TableNameTo, 30, Filters);
            int    RowsDeletedCount = ExtractNextInt(delete2Result, "total rows deleted");

            Assert.True(RowsDeletedCount > 0);

            string copy2Result    = instanceCopy.CopyTableToTable(TableNameTo, TableNameTo2);
            int    SecondRowCount = ExtractNextInt(copy2Result, "total records");

            Assert.Equal(InitialRowCount, SecondRowCount + RowsDeletedCount);
        }
        public void TestCopyAll()
        {
            DeleteAzureTables  instanceDeleteSetup     = new DeleteAzureTables(AzureStorageConfigConnection_ALT1);
            RestoreAzureTables instanceRestoreSetup    = new RestoreAzureTables(AzureStorageConfigConnection_ALT1);
            string             deleteInitializeResult  = instanceDeleteSetup.DeleteAzureTableRows(TableNameTo);
            string             deleteInitialize2Result = instanceDeleteSetup.DeleteAzureTableRows(TableNameTo2);

            DeleteAzureTables instanceDeleteSetup2     = new DeleteAzureTables(AzureStorageConfigConnection_ALT2);
            string            deleteInitializeResult2  = instanceDeleteSetup2.DeleteAzureTableRows(TableNameTo);
            string            deleteInitialize2Result2 = instanceDeleteSetup2.DeleteAzureTableRows(TableNameTo2);

            string restoreResult1 = instanceRestoreSetup.RestoreTableFromFile(TableNameTo, FileNamePathThatExists_UserProfile);
            int    RestoreCount1  = ExtractNextInt(restoreResult1, "Successful;", "entries");

            string restoreResult2 = instanceRestoreSetup.RestoreTableFromFile(TableNameTo2, FileNamePathThatExists_SystemLogs);
            int    RestoreCount2  = ExtractNextInt(restoreResult2, "Successful;", "entries");

            CopyAzureTables instanceCopy = new CopyAzureTables(AzureStorageConfigConnection_ALT1, AzureStorageConfigConnection_ALT2);

            // Check for expected results on the two tables set up. Actual results may have more than these two tables depending on environment.
            string Expected1      = String.Format("Table '{0}' copied to table '{0}', total records {1}.", TableNameTo, RestoreCount1);
            string Expected2      = String.Format("Table '{0}' copied to table '{0}', total records {1}.", TableNameTo2, RestoreCount2);
            string CopyAllResults = instanceCopy.CopyAllTables();

            Assert.Contains(Expected1, CopyAllResults.ToString());
            Assert.Contains(Expected2, CopyAllResults.ToString());
        }
コード例 #3
0
        public void TestBackupToBlob()
        {
            BackupAzureTables  instanceBackup  = new BackupAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);
            CopyAzureTables    instanceCopy    = new CopyAzureTables(AzureStorageConfigConnection);
            DeleteAzureTables  instanceDelete  = new DeleteAzureTables(AzureStorageConfigConnection);
            RestoreAzureTables instanceRestore = new RestoreAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);

            InitializeTables(instanceDelete, instanceRestore, FileNamePathThatExists_SystemLogs);

            List <Filter> Filters = new List <Filter>();

            Filters.Add(new Filter("RowKey", "=", "User1"));
            Filters.Add(new Filter("RowKey", "=", "User2", "OR"));

            string copySetup       = instanceCopy.CopyTableToTable(TableNameFrom, TableNameTo, 30);
            int    InitialRowCount = ExtractNextInt(copySetup, "total records");

            string backupToBlob = instanceBackup.BackupTableToBlob(TableNameFrom, BlobRoot, WorkingDirectory, true, true, 10, 10);
            //int BackupRowCount = ExtractNextInt(backupToBlob, "total records");

            //Need to restore to confirm
            string restoreResult = instanceRestore.RestoreTableFromBlob(TableNameRestoreTo, TableNameFrom, BlobRoot, WorkingDirectory, ExtractFileName(backupToBlob), 30);

            string copyVerify     = instanceCopy.CopyTableToTable(TableNameRestoreTo, TableNameTo2, 30);
            int    VerifyRowCount = ExtractNextInt(copyVerify, "total records");

            Assert.Equal(InitialRowCount, VerifyRowCount);
        }
        public void TestRestoreParameterExceptions()
        {
            RestoreAzureTables instanceRestore = new RestoreAzureTables(AzureStorageConfigConnection);

            var exceptionFromFileDestinationTableName = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromFile("", "xxxx"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromFileDestinationTableName));
            Assert.Contains("DestinationTableName is missing.", exceptionFromFileDestinationTableName.ToString());

            var exceptionFromBlobDestinationTableName = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("", "xx", "BlobRoot", "workingdir", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobDestinationTableName));
            Assert.Contains("DestinationTableName is missing.", exceptionFromBlobDestinationTableName.ToString());

            var exceptionFromBlobOriginalTableNameMissing = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("XX", "", "BlobRoot", "workingdir", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobOriginalTableNameMissing));
            Assert.Contains("OriginalTableName is missing.", exceptionFromBlobOriginalTableNameMissing.ToString());

            var exceptionFromBlobBlobRootMissing = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("XX", "XX", "", "xx", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobBlobRootMissing));
            Assert.Contains("Invalid BlobRoot '' specified.", exceptionFromBlobBlobRootMissing.ToString());

            var exceptionFromBlobBlobRootMissing2 = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("XX", "XX", null, "xx", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobBlobRootMissing2));
            Assert.Contains("Invalid BlobRoot '' specified.", exceptionFromBlobBlobRootMissing2.ToString());

            var exceptionFromBlobWorkingDirectoryMissing = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("XX", "XX", "BlobRoot", "", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobWorkingDirectoryMissing));
            Assert.Contains("WorkingDirectory is missing.", exceptionFromBlobWorkingDirectoryMissing.ToString());
        }
コード例 #5
0
        public void TestRestoreBlobWorkingDirectoryDoesNotExistExceptions()
        {
            RestoreAzureTables rs = new RestoreAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);

            var exceptionBlobFileNameNull = Assert.Throws <ParameterSpecException>(() => rs.RestoreTableFromBlob(DefaultTableNameRestore, DefaultTableNameRestoreOriginal, DefaultBlobRoot, DirectoryDoesNotExist, "blobfile"));

            Assert.Contains("WorkingDirectory does not exist", exceptionBlobFileNameNull.Message);
        }
        public void TestRestoreBadConnSpec()
        {
            RestoreAzureTables rs = new RestoreAzureTables(BadConnectionSpec, AzureBlobStorageConfigConnection);

            Assert.Throws <ConnectionException>(() => rs.RestoreTableFromFile(DefaultTableNameRestore, FileNamePathThatExists, 5));

            rs = new RestoreAzureTables(AzureStorageConfigConnection, BadConnectionSpec);
            Assert.Throws <ConnectionException>(() => rs.RestoreTableFromBlob(DefaultTableNameRestore, DefaultTableNameRestoreOriginal, DefaultBlobRoot, WorkingDirectory, FileNameThatExists, 5));
        }
コード例 #7
0
        private void InitializeTables(DeleteAzureTables instanceDelete, RestoreAzureTables instanceRestore, string FileNamePath)
        {
            instanceDelete.DeleteAzureTableRows(TableNameTo);
            instanceDelete.DeleteAzureTableRows(TableNameTo2);
            instanceDelete.DeleteAzureTableRows(TableNameFrom);

            string restoreResult = instanceRestore.RestoreTableFromFile(TableNameFrom, FileNamePath);
            int    RestoreCount  = ExtractNextInt(restoreResult, "Successful;", "entries");
        }
        public void TestRestoreServerNotRunning()
        {
            RestoreAzureTables rs = new RestoreAzureTables(ConnectionSpecNoServer, AzureBlobStorageConfigConnection);

            Assert.Throws <RestoreFailedException>(() => rs.RestoreTableFromFile(DefaultTableNameRestore, FileNamePathThatExists, 5));

            rs = new RestoreAzureTables(AzureStorageConfigConnection, ConnectionSpecNoServer);
            Assert.Throws <RestoreFailedException>(() => rs.RestoreTableFromBlob(DefaultTableNameRestore, DefaultTableNameRestoreOriginal, DefaultBlobRoot, @"d:\temp\TestRestore\", "UserProfile_Backup_20200505173139.txt", 5));
        }
コード例 #9
0
        public void TestRestoreFileExceptions()
        {
            RestoreAzureTables rs = new RestoreAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);

            var exceptionBadDir = Assert.Throws <ParameterSpecException>(() => rs.RestoreTableFromFile(DefaultTableNameRestore, "baddir"));

            Assert.Contains("Invalid file name/path", exceptionBadDir.Message);

            var exceptionBadFile = Assert.Throws <ParameterSpecException>(() => rs.RestoreTableFromFile(DefaultTableNameRestore, @"d:\temp\test\UserProfile_Backup_NOPE.txt"));

            Assert.Contains("does not exist", exceptionBadFile.Message);
        }
        public void TestDeleteParameterExceptions()
        {
            CopyAzureTables    instanceCopy    = new CopyAzureTables(AzureStorageConfigConnection);
            DeleteAzureTables  instanceDelete  = new DeleteAzureTables(AzureStorageConfigConnection);
            RestoreAzureTables instanceRestore = new RestoreAzureTables(AzureStorageConfigConnection);

            var exception = Assert.Throws <ParameterSpecException>(() => instanceDelete.DeleteAzureTable(""));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exception));
            Assert.Contains("TableNameToDelete is missing.", exception.ToString());

            var exceptionRows = Assert.Throws <ParameterSpecException>(() => instanceDelete.DeleteAzureTableRows(""));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionRows));
            Assert.Contains("TableNameToDelete rows from is missing.", exceptionRows.ToString());
        }
コード例 #11
0
        private string Restore(SecureString AzureBlobStorageConfigConnection, SecureString AzureStorageConfigConnection, IConfiguration config)
        {
            try
            {
                RestoreAzureTables me = new RestoreAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);

                string Target = GetFromParmOrFile(config, TargetParmName).ToLower();
                if (!String.IsNullOrEmpty(Target))
                {
                    if (Target.Contains("file"))
                    {
                        return(me.RestoreTableFromFile(GetFromParmOrFile(config, DestinationTableNameParmName),
                                                       GetFromParmOrFile(config, RestoreFileNamePathParmName),
                                                       GetIntFromParmOrFile(config, TimeoutSecondsParmName)));
                    }
                    else if (Target.Contains("blobdirect"))
                    {
                        return(me.RestoreTableFromBlobDirect(GetFromParmOrFile(config, DestinationTableNameParmName),
                                                             GetFromParmOrFile(config, OriginalTableNameParmName),
                                                             GetFromParmOrFile(config, BlobRootParmName),
                                                             GetFromParmOrFile(config, BlobFileNameParmName),
                                                             GetIntFromParmOrFile(config, TimeoutSecondsParmName)));
                    }
                    else if (Target.Contains("blob"))
                    {
                        return(me.RestoreTableFromBlob(GetFromParmOrFile(config, DestinationTableNameParmName),
                                                       GetFromParmOrFile(config, OriginalTableNameParmName),
                                                       GetFromParmOrFile(config, BlobRootParmName),
                                                       GetFromParmOrFile(config, WorkingDirectoryParmName),
                                                       GetFromParmOrFile(config, BlobFileNameParmName),
                                                       GetIntFromParmOrFile(config, TimeoutSecondsParmName)));
                    }
                    else
                    {
                        throw new Exception("Missing or invalid configuration for requested command.");
                    }
                }
                else
                {
                    throw new Exception("Missing or invalid configuration for requested command.");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #12
0
        public void TestBackupAllTables()
        {
            BackupAzureTables  instanceBackup  = new BackupAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);
            RestoreAzureTables instanceRestore = new RestoreAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);

            string restoreResult1 = instanceRestore.RestoreTableFromFile(TableNameTo, FileNamePathThatExists_UserProfile);
            int    RestoreCount1  = ExtractNextInt(restoreResult1, "Successful;", "entries");

            string restoreResult2 = instanceRestore.RestoreTableFromFile(TableNameTo2, FileNamePathThatExists_SystemLogs);
            int    RestoreCount2  = ExtractNextInt(restoreResult2, "Successful;", "entries");

            string Expected1       = String.Format("Table '{0}' backed up as", TableNameTo);
            string Expected2       = String.Format("Table '{0}' backed up as", TableNameTo2);
            string backupallresult = instanceBackup.BackupAllTablesToBlob(BlobDirectRoot, true, 10, 10);

            Assert.Contains(Expected1, backupallresult.ToString());
            Assert.Contains(Expected2, backupallresult.ToString());
        }
コード例 #13
0
        public void TestRestoreBlobExceptions()
        {
            RestoreAzureTables rs = new RestoreAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);

            var exceptionBlobFileNameNull = Assert.Throws <ParameterSpecException>(() => rs.RestoreTableFromBlob(DefaultTableNameRestore, DefaultTableNameRestoreOriginal, DefaultBlobRoot, "baddir", null));

            Assert.Contains("Invalid BlobFileName", exceptionBlobFileNameNull.Message);

            var exceptionBlobFileNameEmpty = Assert.Throws <ParameterSpecException>(() => rs.RestoreTableFromBlob(DefaultTableNameRestore, DefaultTableNameRestoreOriginal, DefaultBlobRoot, "baddir", ""));

            Assert.Contains("Invalid BlobFileName", exceptionBlobFileNameEmpty.Message);


            var exceptionBlobRootNull = Assert.Throws <ParameterSpecException>(() => rs.RestoreTableFromBlob(DefaultTableNameRestore, DefaultTableNameRestoreOriginal, null, "baddir", "blobfile"));

            Assert.Contains("Invalid BlobRoot", exceptionBlobRootNull.Message);

            var exceptionBlobRootEmpty = Assert.Throws <ParameterSpecException>(() => rs.RestoreTableFromBlob(DefaultTableNameRestore, DefaultTableNameRestoreOriginal, "", "baddir", "blobfile"));

            Assert.Contains("Invalid BlobRoot", exceptionBlobRootEmpty.Message);
        }
コード例 #14
0
        public void TestBackupToBlobDirect_LargeFile()
        {
            BackupAzureTables  instanceBackup  = new BackupAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);
            CopyAzureTables    instanceCopy    = new CopyAzureTables(AzureStorageConfigConnection);
            DeleteAzureTables  instanceDelete  = new DeleteAzureTables(AzureStorageConfigConnection);
            RestoreAzureTables instanceRestore = new RestoreAzureTables(AzureStorageConfigConnection, AzureBlobStorageConfigConnection);

            InitializeTables(instanceDelete, instanceRestore, FileNamePathThatExists_SystemLogs_LargeFile);

            string copySetup       = instanceCopy.CopyTableToTable(TableNameFrom, TableNameTo, 30);
            int    InitialRowCount = ExtractNextInt(copySetup, "total records");

            string backupToBlob   = instanceBackup.BackupTableToBlobDirect(TableNameFrom, BlobRoot, true, 10, 10);
            int    BackupRowCount = ExtractNextInt(backupToBlob, "total records");

            //Need to restore to confirm
            string restoreResult = instanceRestore.RestoreTableFromBlobDirect(TableNameRestoreTo, TableNameFrom, BlobRoot, ExtractFileName(backupToBlob), 30);

            string copyVerify     = instanceCopy.CopyTableToTable(TableNameRestoreTo, TableNameTo2, 30);
            int    VerifyRowCount = ExtractNextInt(copyVerify, "total records");

            Assert.Equal(InitialRowCount, VerifyRowCount);
        }
コード例 #15
0
        public void TestDeleteRows_LargeFile()
        {
            BackupAzureTables  instanceBackup  = new BackupAzureTables(AzureStorageConfigConnection, AzureStorageConfigConnection);
            CopyAzureTables    instanceCopy    = new CopyAzureTables(AzureStorageConfigConnection);
            DeleteAzureTables  instanceDelete  = new DeleteAzureTables(AzureStorageConfigConnection);
            RestoreAzureTables instanceRestore = new RestoreAzureTables(AzureStorageConfigConnection, AzureStorageConfigConnection);

            InitializeTables(instanceDelete, instanceRestore, FileNamePathThatExists_SystemLogs_LargeFile);

            string copySetup       = instanceCopy.CopyTableToTable(TableNameFrom, TableNameTo, 30);
            int    InitialRowCount = ExtractNextInt(copySetup, "total records");

            List <Filter> DeleteFilters = new List <Filter>();

            DeleteFilters.Add(new Filter("PartitionKey", "=", "WebAppLog"));
            string DeleteResult = instanceDelete.DeleteAzureTableRows(TableNameTo, 30, DeleteFilters);
            int    DeleteCount  = ExtractNextInt(DeleteResult, "total rows deleted");

            string copyVerify        = instanceCopy.CopyTableToTable(TableNameTo, TableNameTo2, 30);
            int    RemainingRowCount = ExtractNextInt(copyVerify, "total records");

            Assert.Equal(InitialRowCount, DeleteCount + RemainingRowCount);
        }
コード例 #16
0
        public void TestCopyRowKey()
        {
            CopyAzureTables    instanceCopy    = new CopyAzureTables(AzureStorageConfigConnection);
            DeleteAzureTables  instanceDelete  = new DeleteAzureTables(AzureStorageConfigConnection);
            RestoreAzureTables instanceRestore = new RestoreAzureTables(AzureStorageConfigConnection);

            string deleteInitializeResult  = instanceDelete.DeleteAzureTableRows(TableNameTo);
            string deleteInitialize2Result = instanceDelete.DeleteAzureTableRows(TableNameTo2);
            string deleteInitialize3Result = instanceDelete.DeleteAzureTableRows(TableNameFrom);

            string restoreResult = instanceRestore.RestoreTableFromFile(TableNameFrom, FileNamePathThatExists_UserProfile);
            int    RestoreCount  = ExtractNextInt(restoreResult, "Successful;", "entries");

            List <Filter> Filters = new List <Filter>();

            Filters.Add(new Filter("RowKey", "=", "User1"));
            Filters.Add(new Filter("RowKey", "=", "User2", "OR"));

            string copySetup       = instanceCopy.CopyTableToTable(TableNameFrom, TableNameTo, 30, Filters);
            int    InitialRowCount = ExtractNextInt(copySetup, "total records");

            List <Filter> Filters2 = new List <Filter>();

            Filters2.Add(new Filter("RowKey", "=", "User1"));

            string delete2Result    = instanceDelete.DeleteAzureTableRows(TableNameTo, 30, Filters2);
            int    RowsDeletedCount = ExtractNextInt(delete2Result, "total rows deleted");

            Assert.True(RowsDeletedCount > 0);

            string copy2Result    = instanceCopy.CopyTableToTable(TableNameTo, TableNameTo2);
            int    SecondRowCount = ExtractNextInt(copy2Result, "total records");

            Assert.Equal(InitialRowCount, SecondRowCount + RowsDeletedCount);

            System.Console.WriteLine("Test");
        }
コード例 #17
0
        public void TestRestoreParameterExceptions()
        {
            RestoreAzureTables instanceRestore = new RestoreAzureTables(AzureStorageConfigConnection);

            var exceptionFromFileDestinationTableName = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromFile("", "xxxx"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromFileDestinationTableName));
            Assert.Contains("DestinationTableName is missing.", exceptionFromFileDestinationTableName.ToString());

            var exceptionFromFileInvalidFileNamePath = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromFile(DefaultTableName, "invalid path"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromFileInvalidFileNamePath));
            Assert.Contains("Invalid file name/path 'invalid path' specified.", exceptionFromFileInvalidFileNamePath.ToString());

            var exceptionFromFileFileDoesNotExist = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromFile(DefaultTableName, @"c:\xxxx.txt"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromFileFileDoesNotExist));
            Assert.Contains(@"File 'c:\xxxx.txt' does not exist.", exceptionFromFileFileDoesNotExist.ToString());


            var exceptionFromBlobDestinationTableName = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("", "xx", "BlobRoot", "workingdir", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobDestinationTableName));
            Assert.Contains("DestinationTableName is missing.", exceptionFromBlobDestinationTableName.ToString());

            var exceptionFromBlobOriginalTableNameMissing = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("XX", "", "BlobRoot", "workingdir", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobOriginalTableNameMissing));
            Assert.Contains("OriginalTableName is missing.", exceptionFromBlobOriginalTableNameMissing.ToString());

            var exceptionFromBlobBlobRootMissing = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("XX", "XX", "", "xx", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobBlobRootMissing));
            Assert.Contains("Invalid BlobRoot '' specified.", exceptionFromBlobBlobRootMissing.ToString());

            var exceptionFromBlobBlobRootMissing2 = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("XX", "XX", null, "xx", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobBlobRootMissing2));
            Assert.Contains("Invalid BlobRoot '' specified.", exceptionFromBlobBlobRootMissing2.ToString());

            var exceptionFromBlobWorkingDirectoryMissing = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlob("XX", "XX", "BlobRoot", "", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobWorkingDirectoryMissing));
            Assert.Contains("WorkingDirectory is missing.", exceptionFromBlobWorkingDirectoryMissing.ToString());

            //Blob Direct
            var exceptionFromBlobDirectDestinationTableName = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlobDirect("", "xx", "BlobRoot", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobDirectDestinationTableName));
            Assert.Contains("DestinationTableName is missing.", exceptionFromBlobDirectDestinationTableName.ToString());

            var exceptionFromBlobDirectOriginalTableNameMissing = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlobDirect("XX", "", "BlobRoot", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobDirectOriginalTableNameMissing));
            Assert.Contains("OriginalTableName is missing.", exceptionFromBlobDirectOriginalTableNameMissing.ToString());

            var exceptionFromBlobDirectBlobRootMissing = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlobDirect("XX", "XX", "", "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobDirectBlobRootMissing));
            Assert.Contains("Invalid BlobRoot '' specified.", exceptionFromBlobDirectBlobRootMissing.ToString());

            var exceptionFromBlobDirectBlobRootMissing2 = Assert.Throws <ParameterSpecException>(() => instanceRestore.RestoreTableFromBlobDirect("XX", "XX", null, "blobfilename"));

            Assert.True(typeof(ParameterSpecException).IsInstanceOfType(exceptionFromBlobDirectBlobRootMissing2));
            Assert.Contains("Invalid BlobRoot '' specified.", exceptionFromBlobDirectBlobRootMissing2.ToString());
        }