Exemple #1
0
        public void Add_Unrestricted()
        {
            NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission(PermissionState.Unrestricted);

            Assert.IsTrue(dbdp.IsUnrestricted(), "IsUnrestricted-1");
            // we lose unrestricted by adding an element
            dbdp.Add(defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
            Assert.IsFalse(dbdp.IsUnrestricted(), "IsUnrestricted-2");
            // removing the element doesn't regain unrestricted status
            dbdp.Clear();
            Assert.IsFalse(dbdp.IsUnrestricted(), "IsUnrestricted-3");
        }
		private void Check (string msg, NonAbstractDBDataPermission dbdp, bool blank, bool unrestricted, int count)
		{
			Assert.AreEqual (blank, dbdp.AllowBlankPassword, msg + ".AllowBlankPassword");
			Assert.AreEqual (unrestricted, dbdp.IsUnrestricted (), msg + ".IsUnrestricted");
			if (count == 0)
				Assert.IsNull (dbdp.ToXml ().Children, msg + ".Count != 0");
			else
				Assert.AreEqual (count, dbdp.ToXml ().Children.Count, msg + ".Count");
		}
Exemple #3
0
 private void Check(string msg, NonAbstractDBDataPermission dbdp, bool blank, bool unrestricted, int count)
 {
     Assert.AreEqual(blank, dbdp.AllowBlankPassword, msg + ".AllowBlankPassword");
     Assert.AreEqual(unrestricted, dbdp.IsUnrestricted(), msg + ".IsUnrestricted");
     if (count == 0)
     {
         Assert.IsNull(dbdp.ToXml().Children, msg + ".Count != 0");
     }
     else
     {
         Assert.AreEqual(count, dbdp.ToXml().Children.Count, msg + ".Count");
     }
 }
		public void Add_Unrestricted ()
		{
			NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (PermissionState.Unrestricted);
			Assert.IsTrue (dbdp.IsUnrestricted (), "IsUnrestricted-1");
			// we lose unrestricted by adding an element
			dbdp.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
			Assert.IsFalse (dbdp.IsUnrestricted (), "IsUnrestricted-2");
			// removing the element doesn't regain unrestricted status
			dbdp.Clear ();
			Assert.IsFalse (dbdp.IsUnrestricted (), "IsUnrestricted-3");
		}