Example #1
0
        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, "");
        }
Example #2
0
        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, "");
        }
Example #3
0
        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, "");
        }
Example #4
0
        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, "");
        }