当前位置: 首页>>代码示例>>C#>>正文


C# NonAbstractDBDataPermission.IsSubsetOf方法代码示例

本文整理汇总了C#中MonoTests.System.Data.Common.NonAbstractDBDataPermission.IsSubsetOf方法的典型用法代码示例。如果您正苦于以下问题:C# NonAbstractDBDataPermission.IsSubsetOf方法的具体用法?C# NonAbstractDBDataPermission.IsSubsetOf怎么用?C# NonAbstractDBDataPermission.IsSubsetOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoTests.System.Data.Common.NonAbstractDBDataPermission的用法示例。


在下文中一共展示了NonAbstractDBDataPermission.IsSubsetOf方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsSubsetOf_AllowPreventDifferent_KeyRestrictionBehavior

		public void IsSubsetOf_AllowPreventDifferent_KeyRestrictionBehavior ()
		{
			NonAbstractDBDataPermission pAllow1 = new NonAbstractDBDataPermission (PermissionState.None);
			pAllow1.Add (defaultConnectString, "security=;", KeyRestrictionBehavior.AllowOnly);
			NonAbstractDBDataPermission pAllow2 = new NonAbstractDBDataPermission (PermissionState.None);
			pAllow2.Add (defaultConnectString, "password=;", KeyRestrictionBehavior.AllowOnly);
			NonAbstractDBDataPermission pPrevent1 = new NonAbstractDBDataPermission (PermissionState.None);
			pPrevent1.Add (defaultConnectString, "security=;", KeyRestrictionBehavior.PreventUsage);
			NonAbstractDBDataPermission pPrevent2 = new NonAbstractDBDataPermission (PermissionState.None);
			pPrevent2.Add (defaultConnectString, "password=;", KeyRestrictionBehavior.PreventUsage);

			Assert.IsTrue (pAllow1.IsSubsetOf (pAllow1), "AllowPreventDifferent - pAllow subsetof pAllow");
			Assert.IsTrue (pAllow1.IsSubsetOf (pPrevent2), "AllowPreventDifferent - pAllow subsetof pPrevent");
			Assert.IsTrue (pPrevent1.IsSubsetOf (pAllow2), "AllowPreventDifferent - pPrevent subsetof pAllow");
			Assert.IsTrue (pPrevent1.IsSubsetOf (pPrevent2), "AllowPreventDifferent - pPrevent subsetof pPrevent");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:16,代码来源:DBDataPermissionTest.cs

示例2: IsSubsetOf_BadPermission

		public void IsSubsetOf_BadPermission ()
		{
			NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (PermissionState.Unrestricted);
			dbdp.IsSubsetOf (new SecurityPermission (SecurityPermissionFlag.Assertion));
		}
开发者ID:Profit0004,项目名称:mono,代码行数:5,代码来源:DBDataPermissionTest.cs

示例3: IsSubsetOf_AllowPreventSame_KeyRestrictionBehavior

		public void IsSubsetOf_AllowPreventSame_KeyRestrictionBehavior ()
		{
			NonAbstractDBDataPermission pAllow = new NonAbstractDBDataPermission (PermissionState.None);
			pAllow.Add (defaultConnectString, "password=;", KeyRestrictionBehavior.AllowOnly);
			NonAbstractDBDataPermission pPrevent = new NonAbstractDBDataPermission (PermissionState.None);
			pPrevent.Add (defaultConnectString, "password=;", KeyRestrictionBehavior.PreventUsage);

			Assert.IsTrue (pAllow.IsSubsetOf (pAllow), "AllowPreventSame - pAllow subsetof pAllow");
			Assert.IsTrue (pAllow.IsSubsetOf (pPrevent), "AllowPreventSame - pAllow subsetof pPrevent");
			Assert.IsTrue (pPrevent.IsSubsetOf (pAllow), "AllowPreventSame - pPrevent subsetof pAllow");
			Assert.IsTrue (pPrevent.IsSubsetOf (pPrevent), "AllowPreventSame - pPrevent subsetof pPrevent");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:12,代码来源:DBDataPermissionTest.cs

示例4: IsSubsetOf_BothEmpty_KeyRestrictionBehavior

		public void IsSubsetOf_BothEmpty_KeyRestrictionBehavior ()
		{
			NonAbstractDBDataPermission pAllow = new NonAbstractDBDataPermission (PermissionState.None);
			pAllow.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
			NonAbstractDBDataPermission pPrevent = new NonAbstractDBDataPermission (PermissionState.None);
			pPrevent.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.PreventUsage);

			Assert.IsTrue (pAllow.IsSubsetOf (pAllow), "BothEmpty - pAllow subsetof pAllow");
			Assert.IsTrue (pAllow.IsSubsetOf (pPrevent), "BothEmpty - pAllow subsetof pPrevent");
			Assert.IsTrue (pPrevent.IsSubsetOf (pAllow), "BothEmpty - pPrevent subsetof pAllow");
			Assert.IsTrue (pPrevent.IsSubsetOf (pPrevent), "BothEmpty - pPrevent subsetof pPrevent");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:12,代码来源:DBDataPermissionTest.cs

示例5: IsSubsetOf_AllowBlankPassword

		public void IsSubsetOf_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);

			Assert.IsTrue (ptrue.IsSubsetOf (ptrue), "true subsetof true");
			Assert.IsFalse (ptrue.IsSubsetOf (pfalse), "true subsetof false");
			Assert.IsTrue (pfalse.IsSubsetOf (ptrue), "false subsetof true");
			Assert.IsTrue (pfalse.IsSubsetOf (pfalse), "false subsetof false");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:14,代码来源:DBDataPermissionTest.cs

示例6: IsSubset

		public void IsSubset ()
		{
			NonAbstractDBDataPermission empty = new NonAbstractDBDataPermission (PermissionState.None);
			Assert.IsTrue (empty.IsSubsetOf (empty), "Empty-Empty");

			NonAbstractDBDataPermission dbdp1 = new NonAbstractDBDataPermission (PermissionState.None);
			dbdp1.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
			Assert.IsTrue (empty.IsSubsetOf (dbdp1), "Empty-1");
			Assert.IsFalse (dbdp1.IsSubsetOf (empty), "1-Empty");
			Assert.IsTrue (dbdp1.IsSubsetOf (dbdp1), "1-1");

			NonAbstractDBDataPermission dbdp2 = (NonAbstractDBDataPermission)dbdp1.Copy ();
			dbdp2.Add (defaultConnectString2, String.Empty, KeyRestrictionBehavior.AllowOnly);
			Assert.IsTrue (dbdp1.IsSubsetOf (dbdp2), "1-2");
			Assert.IsFalse (dbdp2.IsSubsetOf (dbdp1), "2-1");
			Assert.IsTrue (dbdp2.IsSubsetOf (dbdp2), "2-2");

			NonAbstractDBDataPermission dbdp3 = new NonAbstractDBDataPermission (PermissionState.None);
			dbdp3.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.PreventUsage);
			Assert.IsTrue (dbdp3.IsSubsetOf (dbdp1), "3-1");
			Assert.IsTrue (dbdp1.IsSubsetOf (dbdp3), "1-3");
			Assert.IsTrue (dbdp3.IsSubsetOf (dbdp3), "3-3");

			NonAbstractDBDataPermission unr = new NonAbstractDBDataPermission (PermissionState.Unrestricted);
			Assert.IsTrue (dbdp1.IsSubsetOf (unr), "1-unrestricted");
			Assert.IsFalse (unr.IsSubsetOf (dbdp1), "unrestricted-1");
			Assert.IsTrue (dbdp2.IsSubsetOf (unr), "2-unrestricted");
			Assert.IsFalse (unr.IsSubsetOf (dbdp2), "unrestricted-2");
			Assert.IsTrue (dbdp3.IsSubsetOf (unr), "3-unrestricted");
			Assert.IsFalse (unr.IsSubsetOf (dbdp3), "unrestricted-3");
			Assert.IsTrue (unr.IsSubsetOf (unr), "unrestricted-unrestricted");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:32,代码来源:DBDataPermissionTest.cs

示例7: IsSubset_Null

		public void IsSubset_Null ()
		{
			NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (PermissionState.None);
			Assert.IsTrue (dbdp.IsSubsetOf (null), "Empty-null");

			dbdp.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
			Assert.IsFalse (dbdp.IsSubsetOf (null), "Element-null");

			dbdp = new NonAbstractDBDataPermission (PermissionState.Unrestricted);
			Assert.IsFalse (dbdp.IsSubsetOf (null), "Unrestricted-null");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:DBDataPermissionTest.cs


注:本文中的MonoTests.System.Data.Common.NonAbstractDBDataPermission.IsSubsetOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。