Beispiel #1
0
 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);
        }
Beispiel #3
0
 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);
 }
Beispiel #4
0
 public void TestThatPasswordCannotBeEmpty()
 {
     regTestOb.password = "";
     results            = TestValidationHelper.Validate(regTestOb);
     Assert.AreEqual(1, results.Count());
     Assert.AreEqual("A password is required", results[0].ErrorMessage);
 }
Beispiel #5
0
        public void TestThatAddressLine1CanHave200Characters()
        {
            regTestOb.addressLine1 = new string('a', 200);

            results = TestValidationHelper.Validate(regTestOb);
            Assert.AreEqual(0, results.Count());
        }
Beispiel #6
0
 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);
 }
Beispiel #7
0
        public void TestThatBirthDateHas8characters()
        {
            regTestOb.birthDate = "2000-10-10";

            results = TestValidationHelper.Validate(regTestOb);
            Assert.AreEqual(0, results.Count());
        }
Beispiel #8
0
 public void TestThatEmailCannotBeEmpty()
 {
     regTestOb.emailAddress = "";
     results = TestValidationHelper.Validate(regTestOb);
     Assert.AreEqual(1, results.Count());
     Assert.AreEqual("An email address is required", results[0].ErrorMessage);
 }
Beispiel #9
0
 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);
 }
Beispiel #10
0
 public void TestThatBirthDateCannotBeEmpty()
 {
     regTestOb.birthDate = "";
     results             = TestValidationHelper.Validate(regTestOb);
     Assert.AreEqual(1, results.Count());
     Assert.AreEqual("A birth date is required", results[0].ErrorMessage);
 }
Beispiel #11
0
 public void TestThatLastNameCannotBeEmpty()
 {
     regTestOb.lastName = "";
     results            = TestValidationHelper.Validate(regTestOb);
     Assert.AreEqual(1, results.Count());
     Assert.AreEqual("A last name is required", results[0].ErrorMessage);
 }
Beispiel #12
0
 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);
 }
Beispiel #13
0
 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);
 }
Beispiel #14
0
 public void TestThatPhoneNumbercannotBeEmpty()
 {
     regTestOb.phoneNumber = "";
     results = TestValidationHelper.Validate(regTestOb);
     Assert.AreEqual(1, results.Count());
     Assert.AreEqual("A phone number is required", results[0].ErrorMessage);
 }
Beispiel #15
0
 //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);
 }
Beispiel #16
0
 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);
 }
Beispiel #17
0
 //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);
 }
Beispiel #18
0
 //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);
 }
Beispiel #19
0
 //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);
 }
Beispiel #20
0
 //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
        }