Example #1
0
        public void ProjectDescriptionMinPlusOne()
        {
            //create an instance of the class we want to create
            clsProject AProject = new clsProject();
            //boolean variable to store the result of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            string ProjectName             = "Website Creation";
            string EstimatedCompletionDate = DateTime.Now.Date.ToString();
            string ProjectDescription      = "aa";//this should pass

            //invoke the method
            OK = AProject.Valid(ProjectName, ProjectDescription, EstimatedCompletionDate);
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
Example #2
0
        public void ProjectNameMinLessOne()
        {
            //create an instance of the class we want to create
            clsProject AProject = new clsProject();
            //boolean variable to store the result of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            string EstimatedCompletionDate = DateTime.Now.Date.ToString();
            string ProjectName             = "";//this should fail
            string ProjectDescription      = "A new Website was created";

            //invoke the method
            OK = AProject.Valid(EstimatedCompletionDate, ProjectName, ProjectDescription);
            //test to see the result is correct
            Assert.IsFalse(OK);
        }
Example #3
0
        public void EstimatedCompletionDateInvalidData()
        {
            //create an instance of the class we want to create
            clsProject AProject = new clsProject();
            //boolean variable to store the result of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            string ProjectName        = "Website Creation";
            string ProjectDescription = "a new website was created";
            //set the EstimatedCompletionDate to a non date value
            string EstimatedCompletionDate = "no EstimatedCompletionDate mentioned";

            //invoke the method
            OK = AProject.Valid(ProjectName, ProjectDescription, EstimatedCompletionDate);
            //test to see that the result is correct
            Assert.IsFalse(OK);
        }
Example #4
0
        public void EstimatedCompletionDateMid()
        {
            //create an instance of the class we want to create
            clsProject AProject = new clsProject();
            //boolean variable to store the result of the validation
            Boolean OK = false;
            //create some test data to pass to the method
            string ProjectName        = "Website Creation";
            string ProjectDescription = "A new Website was created";
            //create a variable to store the test date data
            DateTime TestDate;

            //set the date totodays date
            TestDate = DateTime.Now.Date;
            //convert the date variable to a string variable
            string EstimatedCompletionDate = TestDate.ToString();

            //invoke the method
            OK = AProject.Valid(ProjectName, ProjectDescription, EstimatedCompletionDate);
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }