コード例 #1
0
        public async Task LeaseContainerReleaseAsync_NonLeasedContainer_ThrowsLeaseIdMismatchException()
        {
            IBlobServiceClient client = new BlobServiceClient(AccountSettings);
            var containerName = GenerateSampleContainerName();
            CreateContainer(containerName);

            await client.LeaseContainerReleaseAsync(containerName, FakeLeaseId);

            // expects exception
        }
コード例 #2
0
        public async Task LeaseContainerReleaseAsync_LeasedContainer_ReleasesLease()
        {
            IBlobServiceClient client = new BlobServiceClient(AccountSettings);
            var containerName = GenerateSampleContainerName();
            CreateContainer(containerName);
            var leaseId = LeaseContainer(containerName, null, null);

            await client.LeaseContainerReleaseAsync(containerName, leaseId);

            AssertContainerIsNotLeased(containerName);
        }