Exemple #1
0
        private void DoMenuRenamePolicy()
        {
            var policies = ReturnSelectedDeliveryPolicies();

            if (policies.Count == 1)
            {
                IAssetDeliveryPolicy DelPol = policies.FirstOrDefault();

                string value = DelPol.Name;

                if (Program.InputBox("Policy rename", string.Format("Enter the new name for policy '{0}' :", DelPol.Name), ref value) == DialogResult.OK)
                {
                    try
                    {
                        DelPol.Name = value;
                        DelPol.Update();
                        ListPolicies();
                    }
                    catch
                    {
                        MessageBox.Show("There is a problem when renaming the policy.");
                        return;
                    }
                }
            }
        }
Exemple #2
0
        public void AssetDeliveryPolicyTestUpdate()
        {
            IAssetDeliveryPolicy policy = CreateEnvelopePolicy("AssetDeliveryPolicyTestUpdate");

            string newName = "somenewname";

            policy.Name = newName;
            policy.Update();

            var check = _mediaContext.AssetDeliveryPolicies.Where(p => p.Id == policy.Id).AsEnumerable().Single();

            Assert.AreEqual(newName, check.Name);

            DeleteDeliveryPolicyAndVerify(policy);
        }