コード例 #1
0
        public void FilterbyCarParktestDataFound()
        {
            //create an instance of the class we want to create
            clscarparkCollection FilterCarRegs = new clscarparkCollection();
            //var to store outcome
            Boolean Ok = true;

            //apply a car reg that doesnt exit
            FilterCarRegs.FilterByCarReg("bbgg ttt");
            //check that the coorect number of records are found
            if (FilterCarRegs.Count == 2)
            {
                //check that the first record is id 1
                if (FilterCarRegs.CarParkList[0].carparkid != 151)
                {
                    Ok = false;
                }
                //check that the first record  is id 2
                if (FilterCarRegs.CarParkList[1].carparkid != 152)
                {
                    Ok = false;
                }
            }
            else
            {
                Ok = false;
            }
            //test to see that there are no records
            Assert.IsTrue(Ok);
        }
コード例 #2
0
        public void FilterByCarRegNoneFound()
        {
            //create an instance of the filtered data
            clscarparkCollection FillteredCarReg = new clscarparkCollection();

            //apply a carreg that doesnt exits
            FillteredCarReg.FilterByCarReg("aaa aaa");
            //test to see that there are no records found
            Assert.AreEqual(0, FillteredCarReg.Count);
        }
コード例 #3
0
        public void FilterByCarRegMethodOk()
        {
            //create an innstance of the class containing unfiltered results
            clscarparkCollection AllCarPark = new clscarparkCollection();
            //create  an instance of the filtered data
            clscarparkCollection FilteredCarReg = new clscarparkCollection();

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