public void None_Childs () { SqlClientPermission perm = new SqlClientPermission (PermissionState.None); perm.Add ("data source=localhost;", String.Empty, KeyRestrictionBehavior.AllowOnly); perm.Add ("data source=127.0.0.1;", "password=;", KeyRestrictionBehavior.PreventUsage); Check ("None-Childs-1", perm, false, false, 2); perm.AllowBlankPassword = true; Check ("None-Childs-2", perm, true, false, 2); SqlClientPermission copy = (SqlClientPermission)perm.Copy (); Check ("Copy_None-Childs-1", copy, true, false, 2); copy.AllowBlankPassword = false; Check ("Copy_None-Childs-2", copy, false, false, 2); }
public void Unrestricted_Add () { SqlClientPermission perm = new SqlClientPermission (PermissionState.Unrestricted); Check ("Unrestricted-NoChild", perm, false, true, 0); perm.Add ("data source=localhost;", String.Empty, KeyRestrictionBehavior.AllowOnly); // note: Lost unrestricted state when children was added Check ("Unrestricted-WithChild", perm, false, false, 1); }