public void ClothesNameMinPlusOne() { //create an instance of the class we want to create ClsClothes ClothingItem = new ClsClothes(); //boolean variable to store the result of the validation Boolean OK = false; //Create some test data to pass to the method string ClothesDescription = "Small White T Shirt"; string ClothesName = "White T Shirt"; string ClothesCost = "1"; //invoke the method OK = ClothingItem.Valid(ClothesDescription, ClothesName, ClothesCost); //test to see that the result is correct Assert.IsTrue(OK); }
public void ClothesDescriptionExtremeMax() { //create an instance of the class we want to create ClsClothes ClothingItem = new ClsClothes(); //boolean variable to store the result of the validation Boolean OK = false; //Create some test data to pass to the method string ClothesDescription = ""; ClothesDescription = ClothesDescription.PadRight(500, 'a');// This should tigger an error string ClothesName = "White T Shirt"; string ClothesCost = "1"; //invoke the method OK = ClothingItem.Valid(ClothesDescription, ClothesName, ClothesCost); //test to see that the result is correct Assert.IsFalse(OK); }