Ejemplo n.º 1
0
        public void FilterbyFirstNametestDataFound()
        {
            //create an instance of the class we want to create
            clsCarStaffCollection FilterFirstNames = new clsCarStaffCollection();
            //var to store outcome
            Boolean Ok = true;

            //apply a car reg that doesnt exit
            FilterFirstNames.FilterByStaffName("Omer");
            //check that the coorect number of records are found
            if (FilterFirstNames.Count == 2)
            {
                //check that the first record is id 1
                if (FilterFirstNames.StaffList[0].StaffNo != 6)
                {
                    Ok = false;
                }
                //check that the first record  is id 2
                if (FilterFirstNames.StaffList[1].StaffNo != 7)
                {
                    Ok = false;
                }
            }
            else
            {
                Ok = false;
            }
            //test to see that there are no records
            Assert.IsTrue(Ok);
        }
Ejemplo n.º 2
0
        public void FilterByStaffNameNoneFound()
        {
            //create an instance of the filtered data
            clsCarStaffCollection FillteredStaffName = new clsCarStaffCollection();

            //apply a FirstName that doesnt exits
            FillteredStaffName.FilterByStaffName("aaaa");
            //test to see that there are no records found
            Assert.AreEqual(0, FillteredStaffName.Count);
        }
Ejemplo n.º 3
0
        public void FilterBystaffNameMethodOk()
        {
            //create an innstance of the class containing unfiltered results
            clsCarStaffCollection AllCarStaff = new clsCarStaffCollection();
            //create  an instance of the filtered data
            clsCarStaffCollection FilteredStaffName = new clsCarStaffCollection();

            //apply a blank string(should return all records)
            FilteredStaffName.FilterByStaffName("");
            //test to see that the two values are the same
            Assert.AreEqual(AllCarStaff.Count, FilteredStaffName.Count);
        }