Пример #1
0
        public void ShouldThrowCreateAssetFromFileIfAssetCollectionIsNull()
        {
            AssetBaseCollection nullAssets = null;

            try
            {
                nullAssets.CreateFromFileAsync(string.Empty, AssetCreationOptions.None, CancellationToken.None).Wait();
            }
            catch (AggregateException exception)
            {
                Assert.IsInstanceOfType(exception.InnerException, typeof(ArgumentNullException));
                throw;
            }
        }
Пример #2
0
        public void ShouldThrowCreateAssetFromFolderIfAssetCollectionIsNull()
        {
            AssetBaseCollection nullAssets = null;

            try
            {
                Task <IAsset> assetTask = nullAssets.CreateFromFolderAsync(string.Empty, null, AssetCreationOptions.None, CancellationToken.None);

                this.asset = assetTask.Result;
            }
            catch (AggregateException exception)
            {
                Assert.IsInstanceOfType(exception.InnerException, typeof(ArgumentNullException));
                throw;
            }
        }
Пример #3
0
        public void ShouldThrowCreateAssetFromBlobIfAssetCollectionIsNull()
        {
            var fileName      = @"Media\smallwmv1.wmv";
            var containerName = "createassetfromblobtest-" + Guid.NewGuid();
            var blobClient    = TestHelper.CreateCloudBlobClient();

            this.container = blobClient.GetContainerReference(containerName);
            var sourceBlob = CreateBlobFromFile(this.container, fileName);
            AssetBaseCollection nullAssets = null;

            try
            {
                this.asset = nullAssets.CreateFromBlob(sourceBlob, blobClient.Credentials, AssetCreationOptions.None);
            }
            catch (AggregateException exception)
            {
                Assert.IsInstanceOfType(exception.InnerException, typeof(ArgumentNullException));
                throw;
            }
        }