public async Task Batch_StatusIndicatesCannotRead() { await using TestScenario scenario = Scenario(); Uri uri = scenario.GetInvalidBlobUris(1)[0]; BlobBatchClient client = scenario.GetBlobBatchClient(); using BlobBatch batch = client.CreateBatch(); Response response = batch.DeleteBlob(uri); batch.Dispose(); Assert.AreEqual(0, response.Status); }
public async Task Batch_Homogenous_Delete() { await using TestScenario scenario = Scenario(); Uri[] uris = scenario.GetInvalidBlobUris(2); BlobBatchClient client = scenario.GetBlobBatchClient(); using BlobBatch batch = client.CreateBatch(); batch.DeleteBlob(uris[0]); InvalidOperationException ex = Assert.Throws <InvalidOperationException>( () => batch.SetBlobAccessTier(uris[1], AccessTier.Cool)); batch.Dispose(); StringAssert.Contains("already being used for Delete operations", ex.Message); }
public async Task Batch_Double_Dispose_Response_Still_Available() { await using TestScenario scenario = Scenario(); BlobClient[] blobs = await scenario.CreateBlobsAsync(3); BlobBatchClient client = scenario.GetBlobBatchClient(); Response[] responses = new Response[3]; Response response; using (BlobBatch batch = client.CreateBatch()) { responses[0] = batch.DeleteBlob(blobs[0].Uri); responses[1] = batch.DeleteBlob(blobs[1].Uri); responses[2] = batch.DeleteBlob(blobs[2].Uri); response = await client.SubmitBatchAsync(batch); batch.Dispose(); Assert.AreEqual(3, batch.RequestCount); } scenario.AssertStatus(202, response); scenario.AssertStatus(202, responses); await scenario.AssertDeleted(blobs); }