/** * This method tests that a resident email of 100 characters following the correct email format is valid. */ public void TestThatEmailFieldOf100CharsIsValid() { resident.emailAddress = new string('d', 88) + "@sasktel.net"; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
/** * This method tests that a resident city of 1 character is valid. */ public void TestThatCityFieldOf1CharIsValid() { resident.city = "W"; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
//testing that the collectionDate of a BinStatus object cannot be an empty string public void TestThatBinStatusDateEmptyStringIsInvalid() { testBin.collectionDate = ""; results = TestValidationHelper.Validate(testBin); Assert.AreEqual(1, results.Count); Assert.AreEqual("Collection date is required", results[0].ErrorMessage); }
/** * This method tests that a resident AddressLine1 of 1 character is valid. */ public void TestThatAddressLine1FieldOf1CharIsValid() { resident.addressLine1 = "g"; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
/** * This method tests that a resident AddressLine1 of 200 characters is valid. */ public void TestThatAddressLine1FieldOf200CharsIsValid() { resident.addressLine1 = new string('h', 200); var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
/** * This method tests that a resident city of 100 characters is valid. */ public void TestThatCityFieldOf100CharsIsValid() { resident.city = new string('f', 100); var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
//testing that the binID of a BinStatus object cannot be in an invalid format public void TestThatBinStatusBinIDInvalidFormatIsInvalid() { testBin.binID = "A3/D"; results = TestValidationHelper.Validate(testBin); Assert.AreEqual(1, results.Count); Assert.AreEqual("BinID is not valid", results[0].ErrorMessage); }
//testing that the address of a Site object cannot be 201 characters public void TestThatSiteAddressOfLargeStringIsInvalid() { 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); }
//testing that the collectionDate of a BinStatus object must follow a valid format public void TestThatBinStatusDateBadFormatIsInvalid() { testBin.collectionDate = "20191-101-01"; results = TestValidationHelper.Validate(testBin); Assert.AreEqual(1, results.Count); Assert.AreEqual("Collection date must be a valid date", results[0].ErrorMessage); }
//testing that the status of a BinStatus object cannot be greater than 3 public void TestThatBinStatusGreaterThan3IsInvalid() { testBin.status = 4; results = TestValidationHelper.Validate(testBin); Assert.AreEqual(1, results.Count); Assert.AreEqual("A status can only be the value of 1, 2, or 3", results[0].ErrorMessage); }
//testing that the siteID of a Site object cannot be less than 1 public void TestThatSiteIDLessThanOneIsInvalid() { testSite.siteID = 0; results = TestValidationHelper.Validate(testSite); Assert.AreEqual(1, results.Count); Assert.AreEqual("The siteID must be a valid integer", results[0].ErrorMessage); }
/** * This method tests that a resident Province of 1 character is valid. */ public void TestThatProvinceFieldOf1CharIsValid() { resident.province = "g"; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
/** * This method tests that a resident with a first name of 50 characters is valid. */ public void TestThatFirstNameFieldOf50CharsIsValid() { resident.firstName = new string('h', 50); var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
/** * This method tests that a resident Province of 100 characters is valid. */ public void TestThatProvinceFieldOf100CharsIsValid() { resident.province = new string('h', 100); var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
//testing that the binID of a BinStatus object cannot be an empty string public void TestThatBinStatusBinIDEmptyStringIsInvalid() { testBin.binID = ""; results = TestValidationHelper.Validate(testBin); Assert.AreEqual(1, results.Count); Assert.AreEqual("BinID must be between 1 and 20 characters", results[0].ErrorMessage); }
/** * This method tests that a resident password of 50 characters is valid. */ public void TestThatPasswordFieldOf50CharsIsValid() { resident.password = new string('s', 50); var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
public void TestThatInactiveIsFalse() { testDbItem.inactive = false; var results = TestValidationHelper.Validate(testDbItem); Assert.AreEqual(0, results.Count); //NoError }
/** * This method tests that a resident first name of 51 characters is invalid. */ public void TestThatFirstNameFieldOf51CharsIsInvalid() { resident.firstName = new string('j', 51); var results = TestValidationHelper.Validate(resident); Assert.AreEqual(1, results.Count); Assert.AreEqual("First name must be 50 characters or less.", results[0].ErrorMessage); }
/** * This method tests that a resident first name of an empty string is invalid. */ public void TestThatFirstNameFieldOfEmptyStringIsInvalid() { resident.firstName = ""; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(1, results.Count); Assert.AreEqual("First name is required.", results[0].ErrorMessage); }
/** * This method tests that a resident AddressLine1 of 201 characters is invalid. */ public void TestThatAddressLine1FieldOf201CharsIsInvalid() { resident.addressLine1 = new string('d', 201); var results = TestValidationHelper.Validate(resident); Assert.AreEqual(1, results.Count); Assert.AreEqual("Address line 1 must be 200 characters or less.", results[0].ErrorMessage); }
/** * This method tests that a resident birth date NOT in the date format yyyy-dd-mm is invalid. */ public void TestThatDOBFieldWrongFormatIsInvalid() { resident.birthDate = "222-99-038976"; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(1, results.Count); Assert.AreEqual("Birth date must be a valid date.", results[0].ErrorMessage); }
/** * This method tests that a resident AddressLine2 of 0 characters is valid. */ public void TestThatAddressLine2FieldOf0CharsIsValid() { //test that Address2 of 0 characters is valid resident.addressLine2 = ""; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
/** * This method tests that a resident AddressLine2 of 200 characters is valid. */ public void TestThatAddressLine2FieldOf200CharsIsValid() { //test that addressLine2 of 200 characters is valid resident.addressLine2 = new string('p', 200); var results = TestValidationHelper.Validate(resident); Assert.AreEqual(0, results.Count); }
/** * This method tests that a resident email of NOT following the correct email format is invalid. */ public void TestThatEmailFieldOfWrongFormatIsInvalid() { resident.emailAddress = new string('o', 7); var results = TestValidationHelper.Validate(resident); Assert.AreEqual(1, results.Count); Assert.AreEqual("Email must be in email address format.", results[0].ErrorMessage); }
/** * This method tests that a resident AddressLine1 of empty string is invalid. */ public void TestThatAddressLine1FieldEmptyIsInvalid() { resident.addressLine1 = ""; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(1, results.Count); Assert.AreEqual("Address line 1 is required.", results[0].ErrorMessage); }
/** * This method tests that a resident birth date of any empty string is invalid. */ public void TestThatDOBFieldEmptyIsInvalid() { resident.birthDate = ""; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(1, results.Count); Assert.AreEqual("Birth Date is required.", results[0].ErrorMessage); }
/** * This method tests that a resident email of an empty string is invalid. */ public void TestThatEmailFieldEmptyIsInvalid() { resident.emailAddress = ""; var results = TestValidationHelper.Validate(resident); Assert.AreEqual(1, results.Count); Assert.AreEqual("Email is required.", results[0].ErrorMessage); }
public void TestThatPasswordBetweenSixAndFiftyChars() { //Test password is greater than 6 characters but less than 50 charcaters objCred.password = "******"; // Password at lower boundary //checks against validation helper class sends credentials object and and finds no errors var results = TestValidationHelper.Validate(objCred); Assert.AreEqual(0, results.Count); }
public void TestThatPasswordIsFiftyChar() { //Test Password is 50 characters objCred.password = new string('a', 50); //checks against validation helper class sends credentials object and and finds no errors var results = TestValidationHelper.Validate(objCred); Assert.AreEqual(0, results.Count); }
public void TestThatPhoneNumberTenDigitLength() { //Test phone number contains 10 digits objCred.phoneNumber = "3456789096"; //checks against validation helper class sends credentials object and and finds no errors var results = TestValidationHelper.Validate(objCred); Assert.AreEqual(0, results.Count()); }