public void CheckPrerequisites_StudyListWithoutPrerequisites_NoException()
        {
            List <StudyUnit> studyList  = generateStudyListWithoutPrerequisites();
            StudentRecord    studRecord = generateStudentRecordWithSampleTrimesters();

            studRecord.CheckPrerequisites(studyList);
        }
        public void CheckPrerequisites_TestWithEmptyList_NoErrorMessage()
        {
            StudentRecord    studRecord = generateStudentRecordWithSampleTrimesters();
            List <StudyUnit> studyUnits = new List <StudyUnit>();

            studRecord.CheckPrerequisites(studyUnits);
        }
        public void CheckPrerequisites_StudyListWithMultipleNonExistingPrerequisites_Exception()
        {
            List <StudyUnit> studyList = generateStudyListWithoutPrerequisites();
            List <string>    preReqs;

            // start adding in prerequisites that do not exist
            preReqs = new List <string>();
            preReqs.Add("UECS8888");              // does not exist
            preReqs.Add("UECS1103");              // exists
            studyList[4].prerequisites = preReqs; // add as prerequisites to UECS1202

            preReqs = new List <string>();
            preReqs.Add("UECS5555");              // does not exist
            studyList[6].prerequisites = preReqs; // add as prerequisites to UECS1301

            StudentRecord studRecord = generateStudentRecordWithSampleTrimesters();

            studRecord.CheckPrerequisites(studyList);
        }
        public void CheckPrerequisites_StudyListWithMultipleFailedPrerequisites_Exception()
        {
            List <StudyUnit> studyList = generateStudyListWithoutPrerequisites();
            List <string>    preReqs;

            // start adding in prerequisites which are below passing mark
            preReqs = new List <string>();
            preReqs.Add("UECS1102");              // above passing mark
            preReqs.Add("UECS1101");              // below passing mark
            studyList[4].prerequisites = preReqs; // add as prerequisites to UECS1202

            preReqs = new List <string>();
            preReqs.Add("UECS1301");              // below passing mark
            preReqs.Add("UECS1302");              // below passing mark
            studyList[9].prerequisites = preReqs; // add as prerequisites to UECS2101

            StudentRecord studRecord = generateStudentRecordWithSampleTrimesters();

            studRecord.CheckPrerequisites(studyList);
        }
        public void CheckPrerequisites_StudyListCombinationNonExistentAndFailedPrerequisites_Exception()
        {
            List <StudyUnit> studyList = generateStudyListWithoutPrerequisites();
            List <string>    preReqs;

            // start adding in combination of fulfilled prerequisites, those below passing mark and those non-existent
            preReqs = new List <string>();
            preReqs.Add("UECS5555");              // non existent
            preReqs.Add("UECS1101");              // below passing mark
            studyList[4].prerequisites = preReqs; // add as prerequisites to UECS1202

            preReqs = new List <string>();
            preReqs.Add("UECS1301");              // below passing mark
            preReqs.Add("UECS1303");              // normal met
            preReqs.Add("UECS8888");              // non existent
            studyList[9].prerequisites = preReqs; // add as prerequisites to UECS2101

            StudentRecord studRecord = generateStudentRecordWithSampleTrimesters();

            studRecord.CheckPrerequisites(studyList);
        }
        public void CheckPrerequisites_StudyListWithMultiplePrerequisitesMet_NoException()
        {
            List <StudyUnit> studyList = generateStudyListWithoutPrerequisites();
            List <string>    preReqs;

            // start adding in prerequisites that will be be met
            preReqs = new List <string>();
            preReqs.Add("UECS1102");
            preReqs.Add("UECS1103");
            studyList[4].prerequisites = preReqs; // add as prerequisites to UECS1202

            preReqs = new List <string>();
            preReqs.Add("UECS1201");
            studyList[6].prerequisites = preReqs; // add as prerequisites to UECS1301

            preReqs = new List <string>();
            preReqs.Add("UECS1303");
            studyList[9].prerequisites = preReqs; // add as prerequisites to UECS2101

            StudentRecord studRecord = generateStudentRecordWithSampleTrimesters();

            studRecord.CheckPrerequisites(studyList);
        }
        public void CheckPrerequisites_NullStudyList_Exception()
        {
            StudentRecord studRecord = generateStudentRecordWithSampleTrimesters();

            studRecord.CheckPrerequisites(null);
        }