public void TestTranscriptRepository_Fetches_Terms_against_Student_No_1()
        {
            ITranscriptRepository tr = new TestTranscriptRepository();
            var terms = tr.GetTranscript(1).Terms;

            Assert.IsNotNull(terms);
        }
        public void TestTranscriptRepository_Can_Fetch_Student_Transript_Against_Test_Student_1()
        {
            ITranscriptRepository tr = new TestTranscriptRepository();
            var transcript           = tr.GetTranscript(1);

            Assert.IsNotNull(transcript);
        }
        public void TranscriptService_Fetches_Terms_against_Student_No_1_using_TestTranscriptRepository()
        {
            var tr = new TestTranscriptRepository();
            var ts = new TranscriptService(tr);

            var terms = tr.GetTranscript(1).Terms;

            Assert.IsNotNull(terms);
        }
        public void TestTranscriptRepository_Returns_Valid_Transcript_Data_For_Student_Id_2()
        {
            ITranscriptRepository tr = new TestTranscriptRepository();

            var transcript = tr.GetTranscript(2);

            Assert.IsNotNull(transcript);

            var terms = transcript.Terms;

            Assert.IsNotNull(terms);

            double totalUnitsAttempted  = 0;
            double totalUnitsCompleted  = 0;
            double totalUnitsInProgress = 0;
            double gpaValue             = 0.0;
            double gpaWeight            = 0.0;

            foreach (var term in terms)
            {
                var courses = term.Courses;
                Assert.IsNotNull(courses);

                foreach (var course in courses)
                {
                    totalUnitsAttempted  += course.UnitsAttempted;
                    totalUnitsCompleted  += course.UnitsCompleted;
                    totalUnitsInProgress += course.UnitsInProgress;

                    if (course.GpaWeight != 0)
                    {
                        gpaValue  += course.GpaValue;
                        gpaWeight += course.GpaWeight;
                    }
                }
            }

            double cgpa = gpaValue / gpaWeight;

            Assert.AreEqual(cgpa, transcript.Cgpa);
            Assert.AreEqual(totalUnitsCompleted, transcript.UnitsCompleted);
            Assert.AreEqual(totalUnitsAttempted, transcript.UnitsAttempted);
            Assert.AreEqual(totalUnitsInProgress, transcript.UnitsInProgress);
        }