Ejemplo n.º 1
0
        public async Task CloudPageBlobResizeAsync()
        {
            CloudBlobContainer container = GetRandomContainerReference();

            try
            {
                await container.CreateAsync();

                CloudPageBlob blob  = container.GetPageBlobReference("blob1");
                CloudPageBlob blob2 = container.GetPageBlobReference("blob1");

                await blob.CreateAsync(1024);

                Assert.AreEqual(1024, blob.Properties.Length);
                await blob2.FetchAttributesAsync();

                Assert.AreEqual(1024, blob2.Properties.Length);
                await blob.ResizeAsync(2048);

                Assert.AreEqual(2048, blob.Properties.Length);
                await blob2.FetchAttributesAsync();

                Assert.AreEqual(2048, blob2.Properties.Length);
            }
            finally
            {
                container.DeleteIfExistsAsync().AsTask().Wait();
            }
        }