public void TestThatPasswordCannotbe5CharactersLong() { regTestOb.password = "******"; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("Password must be between 8 and 50 characters", results[0].ErrorMessage); }
public void TestThatIDIsValid() { disposables[0].ID = 1; var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); }
public void TestThatEmailCannotBeInvalidFormat() { regTestOb.emailAddress = "guyemail.com"; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("Email address is not in a valid format", results[0].ErrorMessage); }
public void TestThatPasswordCannotBeEmpty() { regTestOb.password = ""; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("A password is required", results[0].ErrorMessage); }
public void TestThatAddressLine1CanHave200Characters() { regTestOb.addressLine1 = new string('a', 200); results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(0, results.Count()); }
public void TestThatEmailCannotBeMoreThan100Characters() { regTestOb.emailAddress = new string('a', 91) + "@gmail.com"; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("Email address must be between 1 and 100 characters", results[0].ErrorMessage); }
public void TestThatBirthDateHas8characters() { regTestOb.birthDate = "2000-10-10"; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(0, results.Count()); }
public void TestThatEmailCannotBeEmpty() { regTestOb.emailAddress = ""; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("An email address is required", results[0].ErrorMessage); }
public void TestThatLastNameFieldHasMoreThan50Characters() { regTestOb.lastName = new string('a', 51); results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("Last name must be between 1 and 50 characters", results[0].ErrorMessage); }
public void TestThatBirthDateCannotBeEmpty() { regTestOb.birthDate = ""; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("A birth date is required", results[0].ErrorMessage); }
public void TestThatLastNameCannotBeEmpty() { regTestOb.lastName = ""; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("A last name is required", results[0].ErrorMessage); }
public void TestThatFirstNameCannotHaveMorethan50Characters() { regTestOb.firstName = new string('a', 51); results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("First name must be between 1 and 50 characters", results[0].ErrorMessage); }
public void TestThatPhoneNumberCannotBe9Digits() { regTestOb.phoneNumber = "123467891"; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("Phone number must contain 10 digits", results[0].ErrorMessage); }
public void TestThatPhoneNumbercannotBeEmpty() { regTestOb.phoneNumber = ""; results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("A phone number is required", results[0].ErrorMessage); }
//testing that the binID of a BinStatus object cannot be an empty string public void TestThatBinStatusBinIDEmptyStringIsInvalid() { testBinStatus.binID = ""; results = TestValidationHelper.Validate(testBinStatus); Assert.AreEqual(1, results.Count); Assert.AreEqual("BinID must be between 1 and 20 characters", results[0].ErrorMessage); }
public void TestThatPasswordCannotBeMorethan50Characters() { regTestOb.password = new string('a', 51); results = TestValidationHelper.Validate(regTestOb); Assert.AreEqual(1, results.Count()); Assert.AreEqual("Password must be between 8 and 50 characters", results[0].ErrorMessage); }
//tests that an address of 201 characters is invalid public void TestThat201CharAddressIsInvalid() { testSite.address = new String('a', 201); results = TestValidationHelper.Validate(testSite); Assert.AreEqual(1, results.Count()); Assert.AreEqual("Address must be 1 to 200 characters", results[0].ErrorMessage); }
//tests that an address cannot be an empty string public void TestThatBinsWithEmptyAddressNameAreInvalid() { testSite.address = ""; results = TestValidationHelper.Validate(testSite); Assert.AreEqual(1, results.Count()); Assert.AreEqual("Address must be 1 to 200 characters", results[0].ErrorMessage); }
//testing that the binID of a BinStatus object cannot be in an invalid format public void TestThatBinStatusBinIDInvalidFormatIsInvalid() { testBinStatus.binID = "A3/D"; results = TestValidationHelper.Validate(testBinStatus); Assert.AreEqual(1, results.Count); Assert.AreEqual("BinID is not valid", results[0].ErrorMessage); }
//tests that a BinStatus status cannot be less than 1 - acceptable statuses are 1, 2, and 3 public void TestThatBinStatusOfLessThan1IsInvalid() { testBinStatus.status = 0; results = TestValidationHelper.Validate(testBinStatus); Assert.AreEqual(1, results.Count()); Assert.AreEqual("A status can only be the value of 1, 2, or 3", results[0].ErrorMessage); }
public void TestThatRecyclableReasonIs500Characters() { disposables[0].recycleReason = new string('a', 500); var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); }
public void TestThatisEndResultIs500Characters() { disposables[0].endResult = new string('a', 500); var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); }
public void TestThatDescriptionisValid() { disposables[0].description = "PRJ2Cosmo"; var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); //NoError }
public void TestThatInactiveIsFalse() { disposables[0].inactive = false; var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); //NoError }
public void TestThatisqtyRecycledIsValid() { disposables[0].qtyRecycled = 1234567; var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); //Noerror }
public void TestThatisEndResultisValid() { disposables[0].endResult = "toilet paper for babies. this ad was sponsered by huggies"; var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); //Noerror }
public void TestThatRecyclableReasonIsValid() { disposables[0].recycleReason = "Because stone cold steve austin said so"; var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); //noerror }
public void TestThatisRecyclableIsTrue() { disposables[0].isRecyclable = true; var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); //NoError }
public void TestThatPictureIDis90Characters() { disposables[0].imageURL = new string('a', 90); var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); //error }
public void TestThatPictureIDIsAString() { disposables[0].imageURL = "pizza"; var results = TestValidationHelper.Validate(disposables[0]); Assert.AreEqual(0, results.Count); //no errors }