Example #1
0
        public void TelephoneNumberMid()
        {
            //create an instance of the class we want to create
            clsManager AManager = new clsManager();
            //create a string variable to store the result of the validation
            string Error = "";
            //create some test data to test the method
            string Address         = "14 Mayfair Street";
            string EmailAddress    = "*****@*****.**";
            string Firstname       = "Kam";
            string Surname         = "Kaur";
            string Password        = "******";
            string TelephoneNumber = "01234"; //this should be ok

            //invoke the method
            Error = AManager.Valid(Address, EmailAddress, Firstname, Surname, Password, TelephoneNumber);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
Example #2
0
        public void AddressMaxPlusOne()
        {
            //create an instance of the class we want to create
            clsManager AManager = new clsManager();
            //create a string variable to store the result of the validation
            string Error = "";
            //create some test data to test the method
            string Address         = "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm"; //this should trigger an error
            string EmailAddress    = "*****@*****.**";
            string Firstname       = "Kam";
            string Surname         = "Kaur";
            string Password        = "******";
            string TelephoneNumber = "01169877896";

            //invoke the method
            Error = AManager.Valid(Address, EmailAddress, Firstname, Surname, Password, TelephoneNumber);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
Example #3
0
        public void EmailAddressExtremeMax()
        {
            //create an instance of the class we want to create
            clsManager AManager = new clsManager();
            //create a string variable to store the result of the validation
            string Error = "";
            //create some test data to test the method
            string Address      = "14 Mayfair Street";
            string EmailAddress = "";

            EmailAddress = EmailAddress.PadRight(500, 'k'); //this should fail
            string Firstname       = "Kam";
            string Surname         = "Kaur";
            string Password        = "******";
            string TelephoneNumber = "01169877896";

            //invoke the method
            Error = AManager.Valid(Address, EmailAddress, Firstname, Surname, Password, TelephoneNumber);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }