Esempio n. 1
0
        public void CloudBlobContainerExistsAPM()
        {
            CloudBlobContainer container = GetRandomContainerReference();

            try
            {
                using (AutoResetEvent waitHandle = new AutoResetEvent(false))
                {
                    IAsyncResult result = container.BeginExists(
                        ar => waitHandle.Set(),
                        null);
                    waitHandle.WaitOne();
                    Assert.IsFalse(container.EndExists(result));
                    container.Create();
                    result = container.BeginExists(
                        ar => waitHandle.Set(),
                        null);
                    waitHandle.WaitOne();
                    Assert.IsTrue(container.EndExists(result));
                }
            }
            finally
            {
                container.DeleteIfExists();
            }
            Assert.IsFalse(container.Exists());
        }