public void LeaseBlobBreak_LeasedBlobWithLongBreakPeriod_SetLeaseToBreaking() { 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); client.LeaseBlobBreak(containerName, blobName, leaseId, 60); var leaseState = _util.GetBlobLeaseState(containerName, blobName); Assert.AreEqual(Microsoft.WindowsAzure.Storage.Blob.LeaseState.Breaking, leaseState); }
public void LeaseBlobBreak_NonLeasedBlob_ThrowsLeaseNotPresentException() { IBlobServiceClient client = new BlobServiceClient(AccountSettings); var containerName = _util.GenerateSampleContainerName(_runId); var blobName = _util.GenerateSampleBlobName(_runId); _util.CreateContainer(containerName); _util.CreateBlockBlob(containerName, blobName); client.LeaseBlobBreak(containerName, blobName, FakeLeaseId, 0); // expects exception }
public void LeaseBlobBreak_LeasedBlob_BreaksLease() { IBlobServiceClient client = new BlobServiceClient(AccountSettings); var containerName = GenerateSampleContainerName(); var blobName = GenerateSampleBlobName(); CreateContainer(containerName); CreateBlockBlob(containerName, blobName); var leaseId = LeaseBlob(containerName, blobName); client.LeaseBlobBreak(containerName, blobName, leaseId, 0); var leaseState = GetBlobLeaseState(containerName, blobName); Assert.AreEqual(Microsoft.WindowsAzure.Storage.Blob.LeaseState.Broken, leaseState); }