예제 #1
0
        public void ValidMethodOK()
        {
            //create an instance of the class we want to create
            clsColour AColour = new clsColour();
            //string variable to store any error message
            String Error = "";
            //create some test data to assign to the property
            string SomeColourName = "Red";

            //invoke th method
            Error = AColour.Valid(SomeColourName);
            //test to see that the result is OK i.e there was no error message returned
            Assert.AreEqual(Error, "");
        }
예제 #2
0
        public void ColourNameMinBoundary()
        {
            //create an instance of the class we want to create
            clsColour AColour = new clsColour();
            //string variable to store any error message
            String Error = "";
            //create some test data to pass to the method
            string SomeColourName = "aaa"; //this should be ok

            //invoke the method
            Error = AColour.Valid(SomeColourName);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
예제 #3
0
        public void ColourNameExtremeMax()
        {
            //create an instance of the class we want to create
            clsColour AColour = new clsColour();
            //string variable to store any error message
            String Error = "";
            //create some test data to pass to the method
            string SomeColourName = "";

            SomeColourName = SomeColourName.PadRight(50, 'a'); //this should fail
            //invoke the method
            Error = AColour.Valid(SomeColourName);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }