本文整理汇总了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);
}