示例#1
0
 public void TestDateRangeGood()
 {
     m1 = new MemberValidation(0, 1, "John Doe", "*****@*****.**");
     // insert - no exception because default dates are inside valid range
     m1.Persist();
     // clean up
     m1.Remove();
 }
示例#2
0
 public void CustomValidatorBad()
 {
     // exception because listid < id
     m1 = new MemberValidation(1, 0, "John Doe", "*****@*****.**");
     // insert
     m1.Persist();
     // clean up (not executed unless Persist erroneously succeeds)
     m1.Remove();
 }
示例#3
0
 public void CustomValidatorGood()
 {
     // no exception because listid > id
     m1 = new MemberValidation(0, 1, "John Doe", "*****@*****.**");
     // insert
     m1.Persist();
     // clean up
     m1.Remove();
 }
示例#4
0
 public void TestRequiredBadButAllowNull()
 {
     // test that an empty email address throws an exception
     m1 = new Member(list.Id, null, "*****@*****.**");
     // insert
     m1.Persist();
     // delete
     m1.Remove();
 }
示例#5
0
 public void TestRequiredGood()
 {
     // test that an email address (required field) entered passes validation
     m1 = new Member(list.Id, "John Doe", "*****@*****.**");
     // insert
     m1.Persist();
     Assert.AreEqual(m1.Name, "John Doe", "The object was not properly inserted!");
     Assert.AreEqual(m1.Address, "*****@*****.**", "The object was not properly inserted!");
     // delete
     m1.Remove();
 }
示例#6
0
 public void TestRegexGoodData()
 {
     // test that a `good` email address can be entered in the database
     m1 = new Member(list.Id, "John Doe", "*****@*****.**");
     // insert
     m1.Persist();
     Assert.AreEqual(m1.Name, "John Doe", "The object was not properly inserted!");
     Assert.AreEqual(m1.Address, "*****@*****.**", "The object was not properly inserted!");
     // delete
     m1.Remove();
 }
示例#7
0
		public void TestRegexGoodData()
		{
			// test that a `good` email address can be entered in the database
			m1 = new Member( list.Id, "John Doe", "*****@*****.**" );
			// insert
			m1.Persist();
			Assert.AreEqual( m1.Name, "John Doe", "The object was not properly inserted!" );
			Assert.AreEqual( m1.Address, "*****@*****.**", "The object was not properly inserted!" );
			// delete
			m1.Remove();
		}
示例#8
0
		public void TestRequiredGood()
		{
			// test that an email address (required field) entered passes validation
			m1 = new Member( list.Id, "John Doe", "*****@*****.**" );
			// insert
			m1.Persist();
			Assert.AreEqual( m1.Name, "John Doe", "The object was not properly inserted!" );
			Assert.AreEqual( m1.Address, "*****@*****.**", "The object was not properly inserted!" );
			// delete
			m1.Remove();
		}
示例#9
0
		public void CustomValidatorBad()
		{
			// exception because listid < id
			m1 = new MemberValidation( 1, 0, "John Doe", "*****@*****.**" );
			// insert
			m1.Persist();
			// clean up (not executed unless Persist erroneously succeeds)
			m1.Remove();
		}
示例#10
0
		public void CustomValidatorGood()
		{
			// no exception because listid > id
			m1 = new MemberValidation( 0, 1, "John Doe", "*****@*****.**" );
			// insert
			m1.Persist();
			// clean up
			m1.Remove();
		}
示例#11
0
		public void TestDateRangeGood()
		{
			m1 = new MemberValidation( 0, 1, "John Doe", "*****@*****.**" );
			// insert - no exception because default dates are inside valid range
			m1.Persist();
			// clean up
			m1.Remove();
		}
示例#12
0
		public void TestRequiredBadButAllowNull()
		{
			// test that an empty email address throws an exception
			m1 = new Member( list.Id, null, "*****@*****.**" );
			// insert
			m1.Persist();
			// delete
			m1.Remove();
		}