public string CreateTestTableAndContainerNames(string testContext) { var name = "test" + Guid.NewGuid().ToString().Substring(0, 8); TableAndContainerNames.Add(testContext, name); return(name); }
public TableDataStore <T> GetNewTableDataStore <T>(string testContext, bool createIfNotExists = true, bool isPublic = false) where T : new() { var tableAndContainerName = TableAndContainerNames.ContainsKey(testContext) ? TableAndContainerNames[testContext] : CreateTestTableAndContainerNames(testContext); return(new TableDataStore <T>(ConnectionString, tableAndContainerName, createIfNotExists, tableAndContainerName, createIfNotExists, isPublic ? PublicAccessType.Blob : PublicAccessType.None)); }
public string CreateTestTableAndContainerToStorage(string testContext, PublicAccessType publicAccessType) { var name = "test" + Guid.NewGuid().ToString().Substring(0, 8); TableAndContainerNames.Add(testContext, name); CreateStorageTable(name); CreateStorageContainer(name, publicAccessType); return(name); }
public TableDataStore <T> GetNewTableDataStoreWithStorageCredentials <T>(string testContext, bool createIfNotExists = true, bool isPublic = false) where T : new() { var tableAndContainerName = TableAndContainerNames.ContainsKey(testContext) ? TableAndContainerNames[testContext] : CreateTestTableAndContainerNames(testContext); var tableCreds = AzureStorageUtils.GetStorageCredentialsFromConnectionString(ConnectionString); var blobCreds = AzureStorageUtils.GetStorageSharedKeyCredentialFromConnectionString(ConnectionString); var tableUrl = AzureStorageUtils.GetStorageUriFromConnectionString(ConnectionString, AzureStorageUtils.CredentialType.TableStorage); var blobUrl = AzureStorageUtils.GetStorageUriFromConnectionString(ConnectionString, AzureStorageUtils.CredentialType.BlobStorage); return(new TableDataStore <T>(tableCreds, new StorageUri(new Uri(tableUrl)), tableAndContainerName, false, blobCreds, new Uri(blobUrl), tableAndContainerName, false, PublicAccessType.None)); }