Example #1
0
        public void FindMethodOK()
        {
            ClsCar  car   = new ClsCar();
            Boolean Found = false;
            Int32   CarID = 0;

            Found = car.Find(CarID);
            Assert.IsTrue(Found);
        }
Example #2
0
        public void TestOfficeCodeFound()
        {
            ClsCar  car   = new ClsCar();
            Boolean Found = false;
            Boolean OK    = true;
            Int32   CarID = 0;

            Found = car.Find(CarID);
            if (car.OfficeCode != 1)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Example #3
0
        public void TestSoldFound()
        {
            ClsCar  car   = new ClsCar();
            Boolean Found = false;
            Boolean OK    = true;
            Int32   CarID = 0;

            Found = car.Find(CarID);
            if (car.Sold != true)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Example #4
0
        public void TestDescriptionFound()
        {
            ClsCar  car   = new ClsCar();
            Boolean Found = false;
            Boolean OK    = true;
            Int32   CarID = 0;

            Found = car.Find(CarID);
            if (car.Description != "TestDescription")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Example #5
0
        public void TestColourFound()
        {
            ClsCar  car   = new ClsCar();
            Boolean Found = false;
            Boolean OK    = true;
            Int32   CarID = 0;

            Found = car.Find(CarID);
            if (car.Colour != "Blue")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Example #6
0
        public void TestModelFound()
        {
            ClsCar  car   = new ClsCar();
            Boolean Found = false;
            Boolean OK    = true;
            Int32   CarID = 0;

            Found = car.Find(CarID);
            if (car.Model != "Micra")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Example #7
0
        public void TestMakeFound()
        {
            ClsCar  car   = new ClsCar();
            Boolean Found = false;
            Boolean OK    = true;
            Int32   CarID = 0;

            Found = car.Find(CarID);
            if (car.Make != "Nissan")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Example #8
0
        public void TestNumberPlateFound()
        {
            ClsCar  car   = new ClsCar();
            Boolean Found = false;
            Boolean OK    = true;
            Int32   CarID = 0;

            Found = car.Find(CarID);
            if (car.NumberPlate != "1234ABCD")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
Example #9
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        ClsCar  car = new ClsCar();
        int     CarID;
        Boolean Found = false;

        CarID = Convert.ToInt32(txtCarID.Text);
        Found = car.Find(CarID);
        if (Found == true)
        {
            txtNumberPlate.Text = car.NumberPlate;
            txtMake.Text        = car.Make;
            txtModel.Text       = car.Model;
            txtColour.Text      = car.Colour;
            txtDescription.Text = car.Description;
            txtPrice.Text       = car.Price.ToString();
            txtOfficeCode.Text  = car.OfficeCode.ToString();
        }
    }