public void ValidMethodOK() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //string variable to store any error message String Error = ""; //invoke th method Error = ACar.Valid(CarName, Model, BodyType, YearMade); //test to see that the result is correct Assert.AreEqual(Error, ""); }
public void PriceMid() { //create an instance of the class we want to create clsCar AnPrice = new clsCar(); //string variable to store any error message String Error = ""; //create some test data to pass to the method string Price = "2000"; //this should be ok //invoke the method Error = AnPrice.Valid(RegPlate, CarName, CarModel, CarColour, EngineSize, Price); //test to see that the result is correct Assert.AreEqual(Error, ""); }
public void YearMadeInvalidDate() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //string vriable to store any error message String Error = ""; //set YearMade to a non date value string YearMade = "this is not a date"; //invoke the method Error = ACar.Valid(CarName, Model, BodyType, YearMade); //test to see that the result is correct Assert.AreNotEqual(Error, ""); }
public void CarNameMaxPlusOne() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //string variable to store any error message String Error = ""; //create some test data to pass to the method string CarName = "aaaaaaaaaaa"; //this should fail //invoke the method Error = ACar.Valid(CarName, Model, BodyType, YearMade); //test to see that the result is correct Assert.AreNotEqual(Error, ""); }
public void ModelMid() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //boolean variable to store the result of the validation Boolean OK = false; //create some test data to assign to the property string SomeModel = "abcdeabcdeabcdeabcdeabcde"; //invoke the method OK = ACar.Valid(SomeModel); //test to see that the result Assert.IsTrue(OK); }
public void ValidExist() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //boolean variable to store the result of the validation Boolean OK = false; //create some test data to assign string SomeModel = "Ford"; //invoke the method OK = ACar.Valid(SomeModel); //test to see that the result is correct Assert.IsTrue(OK); }
public void BodyTypeMid() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //string variable to store any error message String Error = ""; //this should pass string BodyType = ""; BodyType = BodyType.PadRight(10, 'a'); //invoke the method Error = ACar.Valid(CarName, Model, BodyType, YearMade); //test to see that the result is correct Assert.AreEqual(Error, ""); }
public void ModelMaxPlusOne() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //string variable to store any error message String Error = ""; //this should fail string Model = ""; Model = Model.PadRight(26, 'a'); //invoke the method Error = ACar.Valid(CarName, Model, BodyType, YearMade); //test to see that the result is correct Assert.AreNotEqual(Error, ""); }
public void EngineSizeExtremeMax() { //create an instance of the class we want to create clsCar AnEngineSize = new clsCar(); //string variable to store any error message String Error = ""; //create some test data to pass to the method string EngineSize = ""; //this should be ok EngineSize = EngineSize.PadRight(500, 'a'); //invoke the method Error = AnEngineSize.Valid(RegPlate, CarName, CarModel, CarColour, EngineSize, Price); //test to see that the result is correct Assert.AreNotEqual(Error, ""); }
public void ModelExtremeMax() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //boolean variable to store the result of the validation Boolean OK = false; //create some test data to assign to the property string SomeModel = ""; //pad the string with 'a' charachter SomeModel = SomeModel.PadRight(500, 'a'); //invoke the method OK = ACar.Valid(SomeModel); //test to see that the result is correct Assert.IsFalse(OK); }
public void YearMadeMin() { //create an instance of the class we want to create clsCar ACar = new clsCar(); //string variable to store any error message String Error = ""; //create a variable to store the test date data DateTime TestDate; //set the date totodays date TestDate = DateTime.Now.Date; //convert the date variable to a string variable string YearMade = TestDate.ToString(); //invoke the method Error = ACar.Valid(CarName, Model, BodyType, YearMade); //test to see that the result is correct Assert.AreEqual(Error, ""); }