コード例 #1
0
        public void staffiPhoneExtremeMax()
        {
            //create an instance of a class we want to create
            clsCarStaff AStaff = new clsCarStaff();
            // bhollean variable to store the results of the validation
            Boolean Ok = false;
            // create some test data to pass to the method
            string StaffAddress     = "12c";
            string StaffEmail       = "*****@*****.**";
            string StaffName        = "Cheatan";
            string StaffPhoneNumber = "";

            StaffPhoneNumber = StaffPhoneNumber.PadRight(20, 'a');
            //Invoke the method
            Ok = AStaff.Valid(StaffAddress, StaffEmail, StaffName, StaffPhoneNumber);
            //test to see that the results  is correct
            Assert.IsFalse(Ok);
        }
コード例 #2
0
        public void staffEmailMaxBoundary()
        {
            //create an instance of a class we want to create
            clsCarStaff AStaff = new clsCarStaff();
            // bhollean variable to store the results of the validation
            Boolean Ok = false;
            // create some test data to pass to the method
            string StaffAddress = "12c";
            string StaffEmail   = "";

            StaffEmail = StaffEmail.PadRight(254, 'a');
            string StaffName        = "Chetan";
            string StaffPhoneNumber = "079334355";

            //Invoke the method
            Ok = AStaff.Valid(StaffAddress, StaffEmail, StaffName, StaffPhoneNumber);
            //test to see that the results  is correct
            Assert.IsTrue(Ok);
        }
コード例 #3
0
        public void TestStaffPhoneNumberFound()
        {
            // create an instance of a class we want to create
            clsCarStaff Astaff = new clsCarStaff();
            // boolean variable
            Boolean Found = false;
            // boolean variable
            Boolean OK = true;
            // create test data to pass through
            Int32 StaffNo = 1;

            // execute the method
            Found = Astaff.Find(StaffNo);
            // check the car park id
            if (Astaff.StaffPhoneNumber != "01456612014")
            {
                OK = false;
            }
            // test to see that the result is correct
            Assert.IsTrue(OK);
        }
コード例 #4
0
        public void CarStaffUpdateMethodOk()
        {
            //create an instance of the class we want to create
            clsCarStaffCollection AllCarStaff = new clsCarStaffCollection();
            //create the item of test data
            clsCarStaff TestItem = new clsCarStaff();
            // car to store the rpimary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.StaffNo          = 3;
            TestItem.StaffName        = "Chetan";
            TestItem.StaffAddress     = "80 spence street ";
            TestItem.StaffEmail       = "[email protected] ";
            TestItem.StaffPhoneNumber = "05225889212 ";
            //set thiscar park to the test data
            AllCarStaff.ThisStaff = TestItem;
            //add the record
            PrimaryKey = AllCarStaff.Add();
            // set the primary key of the data
            TestItem.StaffNo = PrimaryKey;
            //modify the test data
            TestItem.StaffNo          = 1003;
            TestItem.StaffName        = "Chetan";
            TestItem.StaffAddress     = "50 spence street ";
            TestItem.StaffEmail       = "[email protected] ";
            TestItem.StaffPhoneNumber = "05225889212 ";
            //set thiscar park to the test data
            AllCarStaff.ThisStaff = TestItem;
            //update the record
            AllCarStaff.Update();
            //find the record
            AllCarStaff.ThisStaff.Find(PrimaryKey);
            //test to see that the two values are the same
            Assert.AreEqual(AllCarStaff.ThisStaff, TestItem);
        }