Beispiel #1
0
        public CourseMeeting FindByCourse(int courseID)
        {
            // Find a course meeting by its courseID.
            CourseMeeting result = courseMeetings.Find(
                delegate(CourseMeeting m_CourseMeeting)
            {
                return(m_CourseMeeting.CourseId == courseID);
            }
                );

            return(result);
        }
Beispiel #2
0
        public CourseMeeting FindByRoom(int roomID)
        {
            // Find a course meeting by room id

            CourseMeeting result = courseMeetings.Find(
                delegate(CourseMeeting m_CourseMeeting)
            {
                return(m_CourseMeeting.RoomId == roomID);
            }
                );

            return(result);
        }
Beispiel #3
0
        public CourseMeeting FindByProfessor(int professorID)
        {
            // Find a course meeting by professor id

            CourseMeeting result = courseMeetings.Find(
                delegate(CourseMeeting m_CourseMeeting)
            {
                return(m_CourseMeeting.ProfessorId == professorID);
            }
                );

            return(result);
        }
Beispiel #4
0
        //*******************************************************
        //Method:  UnitTestCourseMeeting
        //
        //Purpose:  Declares an instance of CourseMeeting and performs
        //          unit testing on all the properties of that
        //          instance.  Called from Main method of
        //          Homework1ConsoleApp.Program.
        //*******************************************************
        public void UnitTestCourseMeeting()
        {
            CourseMeeting myCourseMeeting = new CourseMeeting();

            Console.WriteLine("***************************");
            Console.WriteLine("Unit Testing: CourseMeeting");
            Console.WriteLine("***************************");

            //Unit test of RoomId property
            int testRoomId = 34;

            myCourseMeeting.RoomId = testRoomId;

            if (myCourseMeeting.RoomId == testRoomId)
            {
                Console.WriteLine("CourseMeeting RoomId Property: Pass");
            }
            else
            {
                Console.WriteLine("CourseMeeting RoomId Property: FAIL!");
            }

            //Unit test of CourseId property
            int testCourseId = 600;

            myCourseMeeting.CourseId = testCourseId;

            if (myCourseMeeting.CourseId == testCourseId)
            {
                Console.WriteLine("CourseMeeting CourseId Property: Pass");
            }
            else
            {
                Console.WriteLine("CourseMeeting CourseId Property: FAIL!");
            }

            //Unit test of ProfessorId property
            int testProfessorId = 600;

            myCourseMeeting.ProfessorId = testProfessorId;

            if (myCourseMeeting.ProfessorId == testProfessorId)
            {
                Console.WriteLine("CourseMeeting ProfessorId Property: Pass");
            }
            else
            {
                Console.WriteLine("CourseMeeting ProfessorId Property: FAIL!");
            }

            //Unit test of DayTime property
            string testDayTime = "Mon 10-11am";

            myCourseMeeting.DayTime = testDayTime;

            if (myCourseMeeting.DayTime == testDayTime)
            {
                Console.WriteLine("CourseMeeting DayTime Property: Pass");
            }
            else
            {
                Console.WriteLine("CourseMeeting DayTime Property: FAIL!");
            }

            Console.WriteLine();
        }