コード例 #1
0
        public void CanPersistMetadataASync()
        {
            var sourceBlob = new StandaloneAzureBlockBlob(BasePath, BlobName);
            CreateBlobContent(sourceBlob);

            sourceBlob.Metadata["thing"] = "something";
            sourceBlob.SetMetadataAsync().Wait();

            var loadedBlob = new StandaloneAzureBlockBlob(BasePath, BlobName);
            loadedBlob.FetchAttributes();

            new
            {
                Metadata = new Dictionary<string, string>
                {
                    { "thing", "something"}
                }
            }.ToExpectedObject().ShouldMatch(loadedBlob);
        }
コード例 #2
0
        public void WillThrowOnAsyncSaveOfMetadataIfBlobDoesNotExist(string blobName)
        {
            var blob = new StandaloneAzureBlockBlob(BasePath, blobName);

            AssertEx.Throws<StorageException>(() => blob.SetMetadataAsync());
        }