예제 #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, "");
        }
예제 #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, "");
        }
예제 #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, "");
        }
예제 #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, "");
        }