public async Task DefaultsToOctetStreamWhenLoadingPropertiesWhenPreviouslyUnsetAsync(string blobName)
        {
            var blob = new StandaloneAzureBlockBlob(BasePath, blobName);

            CreateBlobContent(blob);

            await blob.FetchAttributesAsync();

            new
            {
                Properties = new
                {
                    ContentType = "application/octet-stream",
                    Length      = (long)12
                }
            }.ToExpectedObject().ShouldMatch(blob);
        }
示例#2
0
        public async Task CanPersistAndRetrieveMetadataAsync(string blobName)
        {
            var sourceBlob = new StandaloneAzureBlockBlob(BasePath, blobName);

            CreateBlobContent(sourceBlob);

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

            var loadedBlob = new StandaloneAzureBlockBlob(BasePath, blobName);
            await loadedBlob.FetchAttributesAsync();

            new
            {
                Metadata = new Dictionary <string, string>
                {
                    { "thing", "something" }
                }
            }.ToExpectedObject().ShouldMatch(loadedBlob);
        }
        public async Task CanPersistAndRetrievePropertiesAsync(string blobName)
        {
            var sourceBlob = new StandaloneAzureBlockBlob(BasePath, blobName);

            CreateBlobContent(sourceBlob);

            sourceBlob.Properties.ContentType = "something";
            sourceBlob.SetProperties();

            var loadedBlob = new StandaloneAzureBlockBlob(BasePath, blobName);
            await loadedBlob.FetchAttributesAsync();

            new
            {
                Properties = new
                {
                    ContentType = "something",
                    Length      = (long)12
                }
            }.ToExpectedObject().ShouldMatch(loadedBlob);
        }