Ejemplo n.º 1
0
        //*******************************************************************
        //Method: UnitTestCourseMeeting
        //
        //Purpose: Performs a Unit Test for the CourseMeeting class instance.
        //*******************************************************************
        public void UnitTestCourseMeeting()
        {
            //Creates a new CourseMeeting instance
            CourseMeeting ut_CourseMeeting = new CourseMeeting();

            Console.WriteLine();
            Console.WriteLine("***************************");
            Console.WriteLine("Unit Testing CourseMeeting");
            Console.WriteLine("***************************");
            //Unit testing RoomID
            int testRoomID = 10;

            ut_CourseMeeting.n_RoomID = testRoomID;
            if (testRoomID == ut_CourseMeeting.n_RoomID)
            {
                Console.WriteLine("CourseMeeting RoomID Property Test: Pass");
            }
            else
            {
                Console.WriteLine("CourseMeeting RoomID Property Test: Fail");
            }
            //Unit testing CourseID
            int testCourseID = 10;

            ut_CourseMeeting.n_CourseID = testCourseID;
            if (testCourseID == ut_CourseMeeting.n_CourseID)
            {
                Console.WriteLine("CourseMeeting CourseID Property Test: Pass");
            }
            else
            {
                Console.WriteLine("CourseMeeting CourseID Property Test: Fail");
            }
            //Unit testing ProfessorID
            int testProfessorID = 10;

            ut_CourseMeeting.n_ProfessorID = testProfessorID;
            if (testProfessorID == ut_CourseMeeting.n_ProfessorID)
            {
                Console.WriteLine("CourseMeeting ProfessorID Property Test: Pass");
            }
            else
            {
                Console.WriteLine("CourseMeeting ProfessorID Property Test: Fail");
            }
            //Unit testing dayTime
            string TestdayTime = "Afternoon";

            ut_CourseMeeting.n_dayTime = TestdayTime;
            if (TestdayTime == ut_CourseMeeting.n_dayTime)
            {
                Console.WriteLine("CourseMeeting dayTime Property Test: Pass");
            }
            else
            {
                Console.WriteLine("CourseMeeting dayTime Property Test: Fail");
            }
            Console.WriteLine();
        }
Ejemplo n.º 2
0
        //********************************************************************
        //Method: AddCourseMeeting
        //
        //Purpose: Adds a passed in CourseMeeting instance to the DataLayer's
        //         courseMeetings member variable's list, Then fires the
        //         CourseMeetingAdded event.
        //********************************************************************
        public bool AddCourseMeeting(CourseMeeting cm)
        {
            //********************************************************
            //Checks if the CourseMeetingAdded value is null, and will
            //return false, and will not fire any events if the value
            //is null.
            //********************************************************
            if (CourseMeetingAdded == null)
            {
                return(false);
            }
            AddCourseMeetingCollectionEventArgs evtArgs = new AddCourseMeetingCollectionEventArgs(cm);

            courseMeetings.n_courseMeetings.Add(cm);
            CourseMeetingAdded(this, evtArgs);
            return(true);
        }
Ejemplo n.º 3
0
 //********************************************************************
 //Method: RemoveCourseMeetingCollectionEventArgs
 //
 //Purpose: Constructor for the RemoveCourseMeetingCollectionEventArgs
 //         class that assigns data from the passed in CourseMeeting
 //         instance to the coursemeetingRemoved member variable.
 //********************************************************************
 public RemoveCourseMeetingCollectionEventArgs(CourseMeeting cm)
 {
     coursemeetingRemoved = cm;
 }
Ejemplo n.º 4
0
 //*****************************************************************
 //Method: AddCourseMeetingCollectionEventArgs
 //
 //Purpose: Constructor for the AddCourseMeetingCollectionEventArgs
 //         class that assigns data from the passed in CourseMeeting
 //         instance to the coursemeetingAdded member variable.
 //*****************************************************************
 public AddCourseMeetingCollectionEventArgs(CourseMeeting cm)
 {
     coursemeetingAdded = cm;
 }