コード例 #1
0
        public void GetStream()
        {
            var    bytes  = new byte[256];
            Random random = new Random();

            random.NextBytes(bytes);
            var containerName = Guid.NewGuid().ToString().Replace("-", string.Empty);
            var container     = new BinaryContainer(CloudStorageAccount.DevelopmentStorageAccount, containerName);

            container.EnsureExist();

            var id  = Guid.NewGuid().ToString();
            var uri = container.Save(id, bytes, "na");

            using (var stream = container.GetStream(id) as MemoryStream)
            {
                var returned = stream.ToArray();
                Assert.IsTrue(bytes.ContentEquals(returned));
            }
        }
コード例 #2
0
        public void GetStreamNullId()
        {
            var container = new BinaryContainer(CloudStorageAccount.DevelopmentStorageAccount, "asdas");

            container.GetStream(StringHelper.NullEmptyWhiteSpace());
        }