Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        public void Union()
        {
            NonAbstractDBDataPermission empty = new NonAbstractDBDataPermission(PermissionState.None);
            NonAbstractDBDataPermission union = (NonAbstractDBDataPermission)empty.Union(empty);

            Assert.IsNotNull(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);
        }
Beispiel #4
0
        public void Union_BadPermission()
        {
            NonAbstractDBDataPermission dbdp1 = new NonAbstractDBDataPermission(PermissionState.Unrestricted);

            dbdp1.Union(new SecurityPermission(SecurityPermissionFlag.Assertion));
        }
		public void Union_BadPermission ()
		{
			NonAbstractDBDataPermission dbdp1 = new NonAbstractDBDataPermission (PermissionState.Unrestricted);
			dbdp1.Union (new SecurityPermission (SecurityPermissionFlag.Assertion));
		}
		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);
		}
		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);
		}
		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);
		}