Example #1
0
        public void EnrollmentCalcTotalPoints()
        {
            Department comc                = this.school.FindDepartment("COMC");
            Course     comc2750            = new Course(100003, "2750", "UML Modeling and Iterative Process", 2, comc);
            Term       term2020spr         = school.FindTerm(2020, TermsEnum.Spr);
            Section    section2750_2020spr = new Section(100002, 24, comc2750, term2020spr);

            // Add Assignments
            new Assignment(10000001, "1A", "Worksheet, identify student grade info classes",
                           10, DateTime.Parse("1/23/2020"), AssignmentTypesEnum.E, section2750_2020spr);
            new Assignment(10000002, "1B", "UML domain model, library books",
                           10, DateTime.Parse("1/29/2020"), AssignmentTypesEnum.E, section2750_2020spr);
            new Assignment(10000003, "1C", "UML Student Info domain model w/associations",
                           10, DateTime.Parse("1/30/2020"), AssignmentTypesEnum.E, section2750_2020spr);
            new Assignment(10000004, "1D", "Modify 1B (Library system): add attributes & operations",
                           10, DateTime.Parse("2/1/2020"), AssignmentTypesEnum.E, section2750_2020spr);
            new Assignment(10000005, "Q1", "Quiz 1",
                           50, DateTime.Parse("2/2/2020"), AssignmentTypesEnum.Q, section2750_2020spr);

            // Add enrollments
            new Enrollment(10000001, GradeTypesEnum.AF, GradesEnum.Z, school.FindStudent(10000011), section2750_2020spr);
            new Enrollment(10000002, GradeTypesEnum.AF, GradesEnum.Z, school.FindStudent(10000013), section2750_2020spr);
            new Enrollment(10000003, GradeTypesEnum.AF, GradesEnum.Z, school.FindStudent(10000015), section2750_2020spr);
            new Enrollment(10000004, GradeTypesEnum.AF, GradesEnum.Z, school.FindStudent(10000017), section2750_2020spr);
            new Enrollment(10000005, GradeTypesEnum.AF, GradesEnum.Z, school.FindStudent(10000019), section2750_2020spr);
            new Enrollment(10000006, GradeTypesEnum.AF, GradesEnum.Z, school.FindStudent(10000021), section2750_2020spr);
            new Enrollment(10000007, GradeTypesEnum.AF, GradesEnum.Z, school.FindStudent(10000023), section2750_2020spr);

            // Add AssignmentGrades
            new AssignmentGrade(10000001, 10, DateTime.Parse("1/20/2019"),
                                section2750_2020spr.FindEnrollment(10000011), section2750_2020spr.FindAssignment("1A"));
            new AssignmentGrade(10000002, 9, DateTime.Parse("1/21/2019"),
                                section2750_2020spr.FindEnrollment(10000013), section2750_2020spr.FindAssignment("1A"));
            new AssignmentGrade(10000003, 8, DateTime.Parse("1/22/2019"),
                                section2750_2020spr.FindEnrollment(10000015), section2750_2020spr.FindAssignment("1A"));
            new AssignmentGrade(10000004, 7, DateTime.Parse("1/23/2019"),
                                section2750_2020spr.FindEnrollment(10000017), section2750_2020spr.FindAssignment("1A"));
            new AssignmentGrade(10000005, 10, DateTime.Parse("1/20/2019"),
                                section2750_2020spr.FindEnrollment(10000019), section2750_2020spr.FindAssignment("1A"));
            new AssignmentGrade(10000006, 9, DateTime.Parse("1/21/2019"),
                                section2750_2020spr.FindEnrollment(10000021), section2750_2020spr.FindAssignment("1A"));
            new AssignmentGrade(10000007, 8, DateTime.Parse("1/22/2019"),
                                section2750_2020spr.FindEnrollment(10000023), section2750_2020spr.FindAssignment("1A"));
            new AssignmentGrade(10000008, 10, DateTime.Parse("1/23/2019"),
                                section2750_2020spr.FindEnrollment(10000011), section2750_2020spr.FindAssignment("1B"));
            new AssignmentGrade(10000009, 9, DateTime.Parse("1/24/2019"),
                                section2750_2020spr.FindEnrollment(10000013), section2750_2020spr.FindAssignment("1B"));
            new AssignmentGrade(10000010, 8, DateTime.Parse("1/25/2019"),
                                section2750_2020spr.FindEnrollment(10000015), section2750_2020spr.FindAssignment("1B"));
            new AssignmentGrade(10000011, 7, DateTime.Parse("1/26/2019"),
                                section2750_2020spr.FindEnrollment(10000017), section2750_2020spr.FindAssignment("1B"));
            new AssignmentGrade(10000012, 8, DateTime.Parse("1/24/2019"),
                                section2750_2020spr.FindEnrollment(10000019), section2750_2020spr.FindAssignment("1B"));
            new AssignmentGrade(10000013, 9, DateTime.Parse("1/25/2019"),
                                section2750_2020spr.FindEnrollment(10000021), section2750_2020spr.FindAssignment("1B"));
            new AssignmentGrade(10000014, 10, DateTime.Parse("1/23/2019"),
                                section2750_2020spr.FindEnrollment(10000023), section2750_2020spr.FindAssignment("1B"));
            new AssignmentGrade(10000015, 9, DateTime.Parse("1/28/2019"),
                                section2750_2020spr.FindEnrollment(10000011), section2750_2020spr.FindAssignment("1C"));
            new AssignmentGrade(10000016, 8, DateTime.Parse("1/29/2019"),
                                section2750_2020spr.FindEnrollment(10000015), section2750_2020spr.FindAssignment("1C"));
            new AssignmentGrade(10000018, 10, DateTime.Parse("1/26/2019"),
                                section2750_2020spr.FindEnrollment(10000015), section2750_2020spr.FindAssignment("1D"));
            new AssignmentGrade(10000020, 50, DateTime.Parse("1/26/2019"),
                                section2750_2020spr.FindEnrollment(10000015), section2750_2020spr.FindAssignment("Q1"));

            Enrollment enr         = section2750_2020spr.FindEnrollment(10000015);
            int        totalPoints = enr.CalcTotalPoints();

            Assert.AreEqual(84, totalPoints);
        }