public async void LeaseBlobChangeAsync_LeasedBlobToNewLeaseId_ChangesToMatchNewLeaseId() { IBlobServiceClient client = new BlobServiceClient(AccountSettings); var containerName = _util.GenerateSampleContainerName(_runId); var blobName = _util.GenerateSampleBlobName(_runId); _util.CreateContainer(containerName); _util.CreateBlockBlob(containerName, blobName); var leaseId = _util.LeaseBlob(containerName, blobName); var expectedLeaseId = Guid.NewGuid().ToString(); var response = await client.LeaseBlobChangeAsync(containerName, blobName, leaseId, expectedLeaseId); Assert.AreEqual(expectedLeaseId, response.LeaseId); _util.AssertBlobIsLeased(containerName, blobName, expectedLeaseId); }
public async void LeaseBlobChangeAsync_NonexistentBlob_ThrowsBlobNotFoundException() { IBlobServiceClient client = new BlobServiceClient(AccountSettings); var containerName = _util.GenerateSampleContainerName(_runId); var blobName = _util.GenerateSampleBlobName(_runId); _util.CreateContainer(containerName); var expectedLeaseId = Guid.NewGuid().ToString(); await client.LeaseBlobChangeAsync(containerName, blobName, FakeLeaseId, expectedLeaseId); // expects exception }
public async void LeaseBlobChangeAsync_NonLeasedBlob_ThrowsLeaseNotPresentException() { IBlobServiceClient client = new BlobServiceClient(AccountSettings); var containerName = GenerateSampleContainerName(); var blobName = GenerateSampleBlobName(); CreateContainer(containerName); CreateBlockBlob(containerName, blobName); var expectedLeaseId = Guid.NewGuid().ToString(); await client.LeaseBlobChangeAsync(containerName, blobName, FakeLeaseId, expectedLeaseId); // expects exception }