コード例 #1
0
        public void ServiceMinLessOne()
        {
            //create insatance of class
            clsServiceOrder AnOrder = new clsServiceOrder();
            //boolean value to store result of validation., which is intitialised to false
            Boolean OK = false;
            //create some test data to assign to property
            string SomeService = "";

            //invoke the methoid
            OK = AnOrder.Valid(SomeService);
            //test to see if result is ok
            Assert.IsFalse(OK);
        }
コード例 #2
0
        public void ServiceExtremeMax()
        {
            //create insatance of class
            clsServiceOrder AnOrder = new clsServiceOrder();
            //boolean value to store result of validation., which is intitialised to false
            Boolean OK = false;
            //create some test data to assign to property
            string SomeService = "";

            //pad the data with characters.PadRight is a built in method that allows us to pad out an existing string with a set number of a specific character.
            SomeService = SomeService.PadRight(129, 'a');
            //invoke the methoid
            OK = AnOrder.Valid(SomeService);
            //test to see if result is ok
            Assert.IsFalse(OK);
        }