Exemple #1
0
        public void CreateContainer()
        {
            var name  = 'z' + Guid.NewGuid().ToString().Replace('-', 'a');
            var blobs = new BinaryContainer(name);

            blobs.Create().Wait();

            var account = AzureStorage.Get();

            var client    = account.CreateCloudBlobClient();
            var reference = client.GetContainerReference(name);
            var result    = reference.CreateIfNotExists();

            Assert.IsFalse(result);
        }
Exemple #2
0
        public void RoundTrip()
        {
            var data   = new byte[64];
            var random = new Random();

            random.NextBytes(data);
            var objId     = "a" + Guid.NewGuid().ToString();
            var container = new BinaryContainer("test");

            container.Create().Wait();

            container.Save(objId, data);

            var result = container.Get(objId);

            Assert.IsNotNull(result);
            Assert.AreEqual <int>(data.Length, result.Length);
            for (var i = 0; i < data.Length; i++)
            {
                Assert.AreEqual <byte>(data[i], result[i]);
            }
        }