//checks for incorrect format of date public void CourseFormDateFormatTest() { //create instane to test CourseForm stForm = new CourseForm(ref mainform, true); //define a test input and output value bool expectedResult = false; stForm.SetStartDateAdded("19-08-19"); //run the method under test bool actualResult = stForm.ValidateFields(); //checks results Assert.AreEqual(expectedResult, actualResult); //do the same for end data of course form stForm.SetEndDateAdded("0000-00-00"); //run the method under test actualResult = stForm.ValidateFields(); //checks results Assert.AreEqual(expectedResult, actualResult); }
//check course level for incorrect data public void CourseFormCourseLevelErroenousData() { //create instane to test CourseForm stForm = new CourseForm(ref mainform, true); //define a test input and output value bool expectedResult = false; stForm.SetCourseLevelAdded("3"); //run the method under test bool actualResult = stForm.ValidateFields(); //checks results Assert.AreEqual(expectedResult, actualResult); }