示例#1
0
        public void HouseNoMin()
        {
            //create an instance of the class we want to create
            clsCustomer AnCustomer = new clsCustomer();
            //string variable to store any error message
            String Error = "";
            //create some test data to pass to the method
            int CustomerNo = 0; //this should be ok

            //invoke the method
            Error = AnCustomer.Valid(CustomerNo, Name, Surname, Mail, Address, Active);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
示例#2
0
        public void PasswordMid()
        {
            //create an instance of the class we want to create
            clsCustomer ACustomer = new clsCustomer();
            //string variable to store any error message
            String Error = "";
            //this should pass
            string Password = "******";

            //invoke the method
            Error = ACustomer.Valid(Username, Password, Address, DateAdded);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
示例#3
0
        public void ProductIdMinLessOne()
        {
            //create an instance of the class we want to create
            clsCustomer theCustomer = new clsCustomer();
            //string variable to store any error message
            String Error = "";
            //this should fail
            string ProductId = "";

            //invoke the method
            Error = theCustomer.Valid(CustomerRegisteredDate, Name, Point, ProductId);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
示例#4
0
        public void DateAddedInvalidData()
        {
            //create an instance of the class we want to create
            clsCustomer ACustomer = new clsCustomer();
            //string variable to store any error message
            String Error = "";
            //set the DateAdded to a non date value
            string DateAdded = "this is not a date";

            //invoke the method
            Error = ACustomer.Valid(Username, Password, Address, DateAdded);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
示例#5
0
        public void UsernameMaxPlusOne()
        {
            //create an instance of the class we want to create
            clsCustomer ACustomer = new clsCustomer();
            //string variable to store any error message
            String Error = "";
            //create some test data to pass to the method
            string Username = "******"; //this should fail

            //invoke the method
            Error = ACustomer.Valid(Username, Password, Address, DateAdded);
            //test to see that the result is correct
            Assert.AreNotEqual(Error, "");
        }
示例#6
0
        public void DateAddedMin()
        {
            //create an instance of the class we want to create
            clsCustomer ACustomer = new clsCustomer();
            //string variable to store any error message
            String Error = "";
            //create a variable to store the test date data
            DateTime TestDate;

            //set the date to todays date
            TestDate = DateTime.Now.Date;
            //convert the date variable to a string variable
            string DateAdded = TestDate.ToString();

            //invoke the method
            Error = ACustomer.Valid(Username, Password, Address, DateAdded);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
示例#7
0
        public void RegisteredDateInvalidData()

        {
            //create an instance of the class we want to create

            clsCustomer theCustomer = new clsCustomer();

            //string variable to store any error message

            String Error = "";

            string CustomerRegisteredDate = "this is not a date";

            //invoke the method

            Error = theCustomer.Valid(CustomerRegisteredDate, Name, Point, ProductId);

            //test to see that the result is correct

            Assert.AreNotEqual(Error, "");
        }
示例#8
0
        public void PointMinPlusOne()

        {
            //create an instance of the class we want to create

            clsCustomer theCustomer = new clsCustomer();

            //string variable to store any error message

            String Error = "";

            //create some test data to pass to the method

            string Name = "1.0"; //this should be ok

            //invoke the method

            Error = theCustomer.Valid(CustomerRegisteredDate, Name, Point, ProductId);

            //test to see that the result is correct

            Assert.AreEqual(Error, "");
        }