test/SetupStorageFixture.cs
/// <summary>
/// Called immediately after the class has been created, before it is used.
/// </summary>
/// <returns>A task.</returns>
Called immediately after the class has been created, before it is used.
Called immediately after the class has been created before it is used .
public async Task InitializeAsync()
        {
            var builder = new ConfigurationBuilder()
                .AddUserSecrets(System.Reflection.Assembly.GetExecutingAssembly());
            var config = builder.Build();
            string accountName = config["AccountName"];
            string secret = config["AccountKey"];
            string tableName = "test";
            StorageCredentials storageCredentials = new StorageCredentials(accountName, secret);
            CloudStorageAccount account = new CloudStorageAccount(storageCredentials, true);
            CloudTableClient client = account.CreateCloudTableClient();
            this.testTable = client.GetTableReference(tableName);
            await this.testTable.DeleteIfExistsAsync();
            await this.testTable.CreateIfNotExistsAsync();
            TestEntity findableEntity = new TestEntity { PartitionKey = "test", RowKey = "query1", Name = "Findable with get single" };
            TableOperation insertOp = TableOperation.Insert(findableEntity);
            await this.testTable.ExecuteAsync(insertOp);
            TestEntity deletableEntity = new TestEntity { PartitionKey = "test", RowKey = "delete", Name = "Here to be deleted." };
            insertOp = TableOperation.Insert(deletableEntity);
            await this.testTable.ExecuteAsync(insertOp);
            TestEntity list1 = new TestEntity { PartitionKey = "list", RowKey = "one", Name = "list one" };
            insertOp = TableOperation.Insert(list1);
            await this.testTable.ExecuteAsync(insertOp);
            TestEntity list2 = new TestEntity { PartitionKey = "list", RowKey = "two", Name = "list two" };
            insertOp = TableOperation.Insert(list2);
            await this.testTable.ExecuteAsync(insertOp);
            TestEntity list3 = new TestEntity { PartitionKey = "list", RowKey = "three", Name = "list three" };
            insertOp = TableOperation.Insert(list3);
            await this.testTable.ExecuteAsync(insertOp);
            TestEntity row1 = new TestEntity { PartitionKey = "hello", RowKey = "row", Name = "row one" };
            insertOp = TableOperation.Insert(row1);
            await this.testTable.ExecuteAsync(insertOp);
            TestEntity row2 = new TestEntity { PartitionKey = "there", RowKey = "row", Name = "row two" };
            insertOp = TableOperation.Insert(row2);
            await this.testTable.ExecuteAsync(insertOp);
        }
public async Task InitializeAsync ( ) { var builder = new ConfigurationBuilder ( ) . AddUserSecrets ( System . Reflection . Assembly . GetExecutingAssembly ( ) ) ; var config = builder . Build ( ) ; string accountName = config [ " " ] ; string secret = config [ " " ] ; string tableName = " " ; StorageCredentials storageCredentials = new StorageCredentials ( accountName , secret ) ; CloudStorageAccount account = new CloudStorageAccount ( storageCredentials , true ) ; CloudTableClient client = account . CreateCloudTableClient ( ) ; this . testTable = client . GetTableReference ( tableName ) ; await this . testTable . DeleteIfExistsAsync ( ) ; await this . testTable . CreateIfNotExistsAsync ( ) ; TestEntity findableEntity = new TestEntity { PartitionKey = " " , RowKey = " " , Name = " " } ; TableOperation insertOp = TableOperation . Insert ( findableEntity ) ; await this . testTable . ExecuteAsync ( insertOp ) ; TestEntity deletableEntity = new TestEntity { PartitionKey = " " , RowKey = " " , Name = " " } ; insertOp = TableOperation . Insert ( deletableEntity ) ; await this . testTable . ExecuteAsync ( insertOp ) ; TestEntity list1 = new TestEntity { PartitionKey = " " , RowKey = " " , Name = " " } ; insertOp = TableOperation . Insert ( list1 ) ; await this . testTable . ExecuteAsync ( insertOp ) ; TestEntity list2 = new TestEntity { PartitionKey = " " , RowKey = " " , Name = " " } ; insertOp = TableOperation . Insert ( list2 ) ; await this . testTable . ExecuteAsync ( insertOp ) ; TestEntity list3 = new TestEntity { PartitionKey = " " , RowKey = " " , Name = " " } ; insertOp = TableOperation . Insert ( list3 ) ; await this . testTable . ExecuteAsync ( insertOp ) ; TestEntity row1 = new TestEntity { PartitionKey = " " , RowKey = " " , Name = " " } ; insertOp = TableOperation . Insert ( row1 ) ; await this . testTable . ExecuteAsync ( insertOp ) ; TestEntity row2 = new TestEntity { PartitionKey = " " , RowKey = " " , Name = " " } ; insertOp = TableOperation . Insert ( row2 ) ; await this . testTable . ExecuteAsync ( insertOp ) ; }
Called immediately after the class has been created, before it is used.
Called immediately after the class has been created before it is used .
// these need to be read from elsewhere.
None