コード例 #1
0
        public async Task GetBlobListReturnsAllBlobsInContainer()
        {
            var objId1 = Guid.NewGuid().ToString();
            var objId2 = Guid.NewGuid().ToString();

            var azureBlobContainer = new TestAzureBlobContainer(
                CloudConfiguration.GetStorageAccount("DataConnectionString"),
                AzureBlobTestContainer);
            await azureBlobContainer.SaveAsync(objId1, "testText");

            await azureBlobContainer.SaveAsync(objId2, "testText");

            var blobList = azureBlobContainer.GetBlobList().Select(b => b.Name).ToList();

            CollectionAssert.Contains(blobList, objId1);
            CollectionAssert.Contains(blobList, objId2);
        }
コード例 #2
0
        public async Task SaveShouldStoreTheBlob()
        {
            var objId = Guid.NewGuid().ToString();

            var azureBlobContainer = new TestAzureBlobContainer(
                account,
                AzureBlobTestContainer);
            await azureBlobContainer.SaveAsync(objId, "testText");

            Assert.IsNotNull(await azureBlobContainer.GetAsync(objId));
        }
コード例 #3
0
        public async Task SaveShouldStoreTheBlob()
        {
            var objId = Guid.NewGuid().ToString();

            var azureBlobContainer = new TestAzureBlobContainer(
                CloudConfiguration.GetStorageAccount("DataConnectionString"),
                AzureBlobTestContainer);
            await azureBlobContainer.SaveAsync(objId, "testText");

            Assert.IsNotNull(await azureBlobContainer.GetAsync(objId));
        }
コード例 #4
0
        public async Task CreateNewBlob()
        {
            var azureBlobContainer = new TestAzureBlobContainer(
                account,
                AzureBlobTestContainer);

            var objId = Guid.NewGuid().ToString();

            var text = await azureBlobContainer.GetAsync(objId);

            Assert.IsNull(text);

            await azureBlobContainer.SaveAsync(objId, "testText");

            text = await azureBlobContainer.GetAsync(objId);

            Assert.IsNotNull(text);
        }