Microsoft.WindowsAzure.MediaServices.Client.Tests.JobTests.CreateSmoothAsset C# (CSharp) Method

CreateSmoothAsset() private method

private CreateSmoothAsset ( ) : IAsset
return IAsset
        private IAsset CreateSmoothAsset()
        {
            var filePaths = new[] { WindowsAzureMediaServicesTestConfiguration.SmallIsm, WindowsAzureMediaServicesTestConfiguration.SmallIsmc, WindowsAzureMediaServicesTestConfiguration.SmallIsmv };
            return CreateSmoothAsset(filePaths);
        }

Same methods

JobTests::CreateSmoothAsset ( CloudMediaContext mediaContext, string filePaths, AssetCreationOptions options ) : IAsset
JobTests::CreateSmoothAsset ( string filePaths ) : IAsset

Usage Example

Esempio n. 1
0
        public void TestGetEncryptionState()
        {
            IAsset asset = JobTests.CreateSmoothAsset(_mediaContext, _filePaths, AssetCreationOptions.None);
            AssetDeliveryProtocol protocolsToSet = AssetDeliveryProtocol.HLS | AssetDeliveryProtocol.SmoothStreaming | AssetDeliveryProtocol.Dash;
            Dictionary <AssetDeliveryPolicyConfigurationKey, string> configuration = new Dictionary <AssetDeliveryPolicyConfigurationKey, string>()
            {
                { AssetDeliveryPolicyConfigurationKey.EnvelopeBaseKeyAcquisitionUrl, "https://www.test.com/" },
                { AssetDeliveryPolicyConfigurationKey.EnvelopeEncryptionIVAsBase64, Convert.ToBase64String(ContentKeyTests.GetRandomBuffer(16)) }
            };
            IAssetDeliveryPolicy policy = _mediaContext.AssetDeliveryPolicies.Create("Test Policy", AssetDeliveryPolicyType.DynamicEnvelopeEncryption, protocolsToSet, configuration);
            IContentKey          key    = _mediaContext.ContentKeys.Create(Guid.NewGuid(), ContentKeyTests.GetRandomBuffer(16), "Test key", ContentKeyType.EnvelopeEncryption);

            asset.ContentKeys.Add(key);
            asset.DeliveryPolicies.Add(policy);

            AssetEncryptionState state = asset.GetEncryptionState(protocolsToSet);

            Assert.AreEqual(AssetEncryptionState.DynamicEnvelopeEncryption, state);

            state = asset.GetEncryptionState(AssetDeliveryProtocol.Dash | AssetDeliveryProtocol.Hds);
            Assert.AreEqual(AssetEncryptionState.NoSinglePolicyApplies, state);

            state = asset.GetEncryptionState(AssetDeliveryProtocol.Hds);
            Assert.AreEqual(AssetEncryptionState.BlockedByPolicy, state);

            CleanupAsset(asset);
        }
All Usage Examples Of Microsoft.WindowsAzure.MediaServices.Client.Tests.JobTests::CreateSmoothAsset
JobTests