public void InstanceOK()
        {
            //create an instance of the class we want to create
            clsTraining AnTraining = new clsTraining();

            //test to see that it exists
            Assert.IsNotNull(AnTraining);
        }
        public void Training_Course_DescriptionOK()
        {
            //create an instance of the class we want to create
            clsTraining AnTraining = new clsTraining();
            //create some test data to assign to the property
            string TestData = "Runner is a great training course to enrol in";

            //assign the data to the property
            AnTraining.Training_Course_Description = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnTraining.Training_Course_Description, TestData);
        }
        public void Training_Course_TypeOK()
        {
            //create an instance of the class we want to create
            clsTraining AnTraining = new clsTraining();
            //create some test data to assign to the property
            string TestData = "Software Developer";

            //assign the data to the property
            AnTraining.Training_Course_Type = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnTraining.Training_Course_Type, TestData);
        }
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsTraining AnTraining = new clsTraining();
            //boolean variable to store the reslt of the validation
            Boolean Found = false;
            //create some test data to use with the method
            int Training_CourseId = 1;

            //invoke the method
            Found = AnTraining.Find(Training_CourseId);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
        public void Training_Course_NameMin()
        {
            //create an instance of the class we want to create
            clsTraining AnTraining = new clsTraining();
            //Boolean variable to store the result of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            string Training_Course_Name        = "a";//This should trigger an Pass
            string Training_Course_Type        = "Software Developer";
            string Training_Course_Description = "Runner is a great training course to enrol in";

            //invoke the method
            OK = AnTraining.Valid(Training_Course_Name, Training_Course_Type, Training_Course_Description);
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
        public void ValidMethodOK()
        {
            //create an instance of the class we want to create
            clsTraining AnTraining = new clsTraining();
            //string variable to store any error message
            Boolean OK = false;
            //create some test data to pass to the method
            string Training_Course_Name        = "Runner";
            string Training_Course_Type        = "Software Developer";
            string Training_Course_Description = "Runner is a great training course to enrol in";

            //invoke the method
            OK = AnTraining.Valid(Training_Course_Name, Training_Course_Type, Training_Course_Description);
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
        public void Training_Course_DescriptionMaxPlusOne()
        {
            //create an instance of the class we want to create
            clsTraining AnTraining = new clsTraining();
            //Boolean variable to store the result of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            string Training_Course_Name        = "Runner";
            string Training_Course_Type        = "Software Developer";
            string Training_Course_Description = "";//This should trigger an False

            Training_Course_Description = Training_Course_Description.PadRight(101, 'a');
            //invoke the method
            OK = AnTraining.Valid(Training_Course_Name, Training_Course_Type, Training_Course_Description);
            //test to see that the result is correct
            Assert.IsFalse(OK);
        }
        public void TestTraining_Course_DescriptionFound()
        {
            //create an instance of the class we want to create
            clsTraining AnTraining = new clsTraining();
            //boolean variable to store the reslt of the validation
            bool Found = false;
            //boolean variable to records if data is ok (Asume it is)
            bool OK = true;
            //create some test data to use with the method
            int Training_CourseId = 1;

            //invoke the method
            Found = AnTraining.Find(Training_CourseId);
            //check the booking NO
            if (AnTraining.Training_Course_Description != "Runner is a great training course to enrol in")
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }