Beispiel #1
0
        public GivenARollingBlobWriterOnExistingBlob()
        {
            _storageAccount = TestUtilities.GetStorageAccount();
            _containerName  = "test" + Guid.NewGuid().ToString("N").ToLowerInvariant();

            GetContainer().Create();

            var existingBlobWriter =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of <IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);

            _existingBlobContents = new string('z', 300);

            existingBlobWriter.WriteAsync(
                new[]
            {
                TestUtilities.CreateBlockData(_existingBlobContents, BlockSize)
            },
                CancellationToken.None).Wait();

            _sut =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of <IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);
        }
        public GivenARollingBlobWriterOnExistingBlob()
        {
            _storageAccount = TestUtilities.GetStorageAccount();
            _containerName = "test" + Guid.NewGuid().ToString("N").ToLowerInvariant();

            GetContainer().Create();

            var existingBlobWriter =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of<IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);

            _existingBlobContents = new string('z', 300);

            existingBlobWriter.WriteAsync(
                new[] 
                {
                    TestUtilities.CreateBlockData(_existingBlobContents, BlockSize)
                },
                CancellationToken.None).Wait();

            _sut =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of<IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);
        }
        public GivenARollingBlobWriter()
        {
            _storageAccount = TestUtilities.GetStorageAccount();
            _containerName = "test" + Guid.NewGuid().ToString("N").ToLowerInvariant();

            GetContainer().Create();

            _sut =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of<IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);
        }
        public GivenARollingBlobWriter()
        {
            _storageAccount = TestUtilities.GetStorageAccount();
            _containerName  = "test" + Guid.NewGuid().ToString("N").ToLowerInvariant();

            GetContainer().Create();

            _sut =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of <IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);
        }
        public GivenARollingBlobWriterOnExistingBlobs()
        {
            _storageAccount = TestUtilities.GetStorageAccount();
            _containerName = "testesistingblobs" + Guid.NewGuid().ToString("N").ToLowerInvariant();

            GetContainer().Create();

            var existingBlobWriter =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of<IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);

            // setup first blob
            existingBlobWriter.WriteAsync(
                new[] 
                {
                    TestUtilities.CreateBlockData(new string('z', 1024*1024), BlockSize),
                },
                CancellationToken.None).Wait();

            // setup a payload of 1023KB for second blob
            _existingBlobContents = new string('z', 1024 * 1024 - 1024);

            // setup second blob
            existingBlobWriter.WriteAsync(
                new[] 
                {
                    TestUtilities.CreateBlockData(_existingBlobContents, BlockSize),
                },
                CancellationToken.None).Wait();

            _sut =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of<IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);
        }
Beispiel #6
0
        public GivenARollingBlobWriterOnExistingBlobs()
        {
            _storageAccount = TestUtilities.GetStorageAccount();
            _containerName  = "testesistingblobs" + Guid.NewGuid().ToString("N").ToLowerInvariant();

            GetContainer().Create();

            var existingBlobWriter =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of <IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);

            // setup first blob
            existingBlobWriter.WriteAsync(
                new[]
            {
                TestUtilities.CreateBlockData(new string('z', 1024 * 1024), BlockSize),
            },
                CancellationToken.None).Wait();

            // setup a payload of 1023KB for second blob
            _existingBlobContents = new string('z', 1024 * 1024 - 1024);

            // setup second blob
            existingBlobWriter.WriteAsync(
                new[]
            {
                TestUtilities.CreateBlockData(_existingBlobContents, BlockSize),
            },
                CancellationToken.None).Wait();

            _sut =
                new RollingBlobWriter.RollingBlobWriter(
                    Mock.Of <IBlobNamingStrategy>(ns => ns.GetNamePrefix() == Prefix),
                    _storageAccount,
                    _containerName,
                    rollSizeMb: 1,
                    blocksAllowed: BlocksAllowed,
                    blockSize: BlockSize);
        }