public void InstanceOK() { //create an instance of the class we want to create clsTown ATown = new clsTown(); //Test to see it exists Assert.IsNotNull(ATown); }
public void TownPropertyOK() { //create an instance of the class we want to create clsTown ATown = new clsTown(); //create some test data to assign the property string SomeTown = "Leicester"; //assign the data of the property ATown.Town = SomeTown; //test to see the two values are the same Assert.AreEqual(ATown.Town, SomeTown); }
public void ValidMethodOK() { //create an instance of the class we want to create clsTown ATown = new clsTown(); //string variable to store any error message String Error = ""; string SomeTown = "Leicester"; //assign the data of the property Error = ATown.Valid(SomeTown); //test to see the results are ok Assert.AreEqual(Error, ""); }
public void TownMinPlusOne() { //create an instance of the class we want to create clsTown ATown = new clsTown(); //string variable to store any error message String Error = ""; //create some test data to pass the method string SomeTown = "aa"; //Invoke the method Error = ATown.Valid(SomeTown); //test to see the result is correct Assert.AreEqual(Error, ""); }
public void TownExtremeMax() { //create an instance of the class we want to create clsTown ATown = new clsTown(); //string variable to store any error message String Error = ""; //create some test data to pass the method string SomeTown = ""; SomeTown = SomeTown.PadRight(500, 'a'); Error = ATown.Valid(SomeTown); //test to see the result is correct Assert.AreNotEqual(Error, ""); }
public void TownMaxLessOne() { //create an instance of the class we want to create clsTown ATown = new clsTown(); //string variable to store any error message String Error = ""; //create some test data to pass the method string SomeTown = ""; //pad the string with characters SomeTown = SomeTown.PadRight(49, 'a'); //Invoke the method Error = ATown.Valid(SomeTown); //test to see the result is correct Assert.AreEqual(Error, ""); }
public void CountMatchesList() { //create an instance of our class clsCustomer clsTownCollection Towns = new clsTownCollection(); //create some test data to assign the property //in this case the data needs to be a list of objects List <clsTown> TestList = new List <clsTown>(); //add an item to the lsit //create the item of test data clsTown TestItem = new clsTown(); //set its propeties TestItem.TownNo = 1; TestItem.Town = "Leicester"; //add the item to the test list TestList.Add(TestItem); //assign the data to the property Towns.AllTowns = TestList; //test to see that the two values are the same Assert.AreEqual(Towns.AllTowns, TestList); }