本文整理匯總了C#中MonoTests.System.Data.Common.NonAbstractDBDataPermission.Union方法的典型用法代碼示例。如果您正苦於以下問題:C# NonAbstractDBDataPermission.Union方法的具體用法?C# NonAbstractDBDataPermission.Union怎麽用?C# NonAbstractDBDataPermission.Union使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MonoTests.System.Data.Common.NonAbstractDBDataPermission
的用法示例。
在下文中一共展示了NonAbstractDBDataPermission.Union方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Union_BadPermission
public void Union_BadPermission ()
{
NonAbstractDBDataPermission dbdp1 = new NonAbstractDBDataPermission (PermissionState.Unrestricted);
dbdp1.Union (new SecurityPermission (SecurityPermissionFlag.Assertion));
}
示例2: Union
public void Union ()
{
NonAbstractDBDataPermission empty = new NonAbstractDBDataPermission (PermissionState.None);
NonAbstractDBDataPermission union = (NonAbstractDBDataPermission) empty.Union (empty);
Assert.IsNull (union, "Empty U Empty");
NonAbstractDBDataPermission dbdp1 = new NonAbstractDBDataPermission (PermissionState.None);
dbdp1.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
union = (NonAbstractDBDataPermission) empty.Union (dbdp1);
Check ("Empty U 1", union, false, false, 1);
NonAbstractDBDataPermission dbdp2 = (NonAbstractDBDataPermission)dbdp1.Copy ();
dbdp2.Add (defaultConnectString2, String.Empty, KeyRestrictionBehavior.AllowOnly);
union = (NonAbstractDBDataPermission) dbdp1.Union (dbdp2);
Check ("1 U 2", union, false, false, 2);
NonAbstractDBDataPermission dbdp3 = new NonAbstractDBDataPermission (PermissionState.None);
dbdp3.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.PreventUsage);
union = (NonAbstractDBDataPermission) dbdp2.Union (dbdp3);
Check ("2 U 3", union, false, false, 2);
NonAbstractDBDataPermission dbdp4 = new NonAbstractDBDataPermission (PermissionState.None);
dbdp4.Add (defaultConnectString, "Data Source=;", KeyRestrictionBehavior.PreventUsage);
union = (NonAbstractDBDataPermission) dbdp3.Union (dbdp4);
Check ("3 U 4", union, false, false, 1);
NonAbstractDBDataPermission unr = new NonAbstractDBDataPermission (PermissionState.Unrestricted);
union = (NonAbstractDBDataPermission) unr.Union (empty);
Check ("unrestricted U empty", union, false, true, 0);
union = (NonAbstractDBDataPermission)unr.Union (dbdp4);
Check ("unrestricted U 4", union, false, true, 0);
}
示例3: Union_AllowBlankPassword
public void Union_AllowBlankPassword ()
{
NonAbstractDBDataPermission ptrue = new NonAbstractDBDataPermission (PermissionState.None);
ptrue.AllowBlankPassword = true;
ptrue.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
NonAbstractDBDataPermission pfalse = new NonAbstractDBDataPermission (PermissionState.None);
pfalse.AllowBlankPassword = false;
pfalse.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
NonAbstractDBDataPermission union = (NonAbstractDBDataPermission) ptrue.Union (ptrue);
Check ("true U true", union, true, false, 1);
union = (NonAbstractDBDataPermission)ptrue.Union (pfalse);
Check ("true U false", union, true, false, 1);
union = (NonAbstractDBDataPermission)pfalse.Union (ptrue);
Check ("false U true", union, true, false, 1);
union = (NonAbstractDBDataPermission)pfalse.Union (pfalse);
Check ("false U false", union, false, false, 1);
}
示例4: Union_Null
public void Union_Null ()
{
NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (PermissionState.None);
NonAbstractDBDataPermission union = (NonAbstractDBDataPermission) dbdp.Union (null);
Check ("Empty U null", dbdp, false, false, 0);
dbdp.AllowBlankPassword = true;
dbdp.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
union = (NonAbstractDBDataPermission) dbdp.Union (null);
Check ("Element U null", dbdp, true, false, 1);
dbdp = new NonAbstractDBDataPermission (PermissionState.Unrestricted);
union = (NonAbstractDBDataPermission) dbdp.Union (null);
Check ("Unrestricted U null", dbdp, false, true, 0);
}