コード例 #1
0
ファイル: tstCar.cs プロジェクト: Rfretwell1/CarDealershipNew
        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);
        }
コード例 #2
0
ファイル: tstCar.cs プロジェクト: Rfretwell1/CarDealershipNew
        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);
        }
コード例 #3
0
ファイル: tstCar.cs プロジェクト: Rfretwell1/CarDealershipNew
        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);
        }
コード例 #4
0
ファイル: tstCar.cs プロジェクト: Rfretwell1/CarDealershipNew
        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);
        }
コード例 #5
0
ファイル: tstCar.cs プロジェクト: Rfretwell1/CarDealershipNew
        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, "");
        }
コード例 #6
0
ファイル: tstCar.cs プロジェクト: Rfretwell1/CarDealershipNew
        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);
        }
コード例 #7
0
ファイル: tstCar.cs プロジェクト: Rfretwell1/CarDealershipNew
        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, "");
        }
コード例 #8
0
ファイル: tstCar.cs プロジェクト: Rfretwell1/CarDealershipNew
        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, "");
        }