Ejemplo n.º 1
0
        public void InstanceOk()
        {
            //create an isntance of the class we want to create
            clsCar ACar = new clsCar();

            //test to see if it exists
            Assert.IsNotNull(ACar);
        }
Ejemplo n.º 2
0
        public void ColourOk()
        {
            //create an isntance of the class we want to create
            clsCar ACar = new clsCar();
            //create some test data to assaign to the property
            String TestData = "Blue";

            //assign the data to the property
            ACar.Colour = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(ACar.Colour, TestData);
        }
Ejemplo n.º 3
0
        public void AgeOk()
        {
            //create an isntance of the class we want to create
            clsCar ACar = new clsCar();
            //create some test data to assaign to the property
            int TestData = 30;

            //assign the data to the property
            ACar.Age = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(ACar.Age, TestData);
        }
Ejemplo n.º 4
0
        public void ActiveCaryOk()
        {
            //create an isntance of the class we want to create
            clsCar ACar = new clsCar();
            //create some test data to assaign to the property
            Boolean TestData = true;

            //assign the data to the property
            ACar.Active = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(ACar.Active, TestData);
        }
Ejemplo n.º 5
0
        public void ValidMethodOK()
        {
            //create an instance of the class we want to create
            clsCar ACar = new clsCar();
            //booleon variable to store teh result of the validation
            string Error = "";

            //invoke the method
            Error = ACar.Valid(CarModel, CarMake, Colour, Mileage, BodyType, Age);
            //test to see if the result is correct
            Assert.AreEqual(Error, "");
        }
Ejemplo n.º 6
0
        public void MileageOK()
        {
            //create an isntance of the class we want to create
            clsCar ACar = new clsCar();
            //create some test data to assign to the property
            Int32 TestData = 100000;

            //Assign the data to the property
            ACar.Mileage = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(ACar.Mileage, TestData);
        }
Ejemplo n.º 7
0
        public void AgeMid()
        {
            //create an instance of the class we want
            clsCar ACar = new clsCar();
            //booleon variable to store the result of the validation
            string Error = "";
            //create some data to assign to the property
            string Age = "50";

            //invoke the method
            Error = ACar.Valid(CarModel, CarMake, Colour, Mileage, BodyType, Age);
            //test to see if the result is correct
            Assert.AreEqual(Error, "");
        }
Ejemplo n.º 8
0
        public void BodyTypeExtremeMax()
        {
            //create an instance of the class we want
            clsCar ACar = new clsCar();
            //booleon variable to store the result of the validation
            string Error = "";
            //create some data to assign to the property
            string BodyType = "";

            //pad the data
            BodyType = BodyType.PadRight(50, 'j');
            //invoke the method
            Error = ACar.Valid(CarModel, CarMake, Colour, Mileage, BodyType, Age);
            //test to see if the result is correct
            Assert.AreNotEqual(Error, "");
        }