public void SqlTranscriptRepository_Can_Fetch_Student_Transript_Against_A_Valid_Student_2494()
        {
            ITranscriptRepository tr = new SqlTranscriptRepository();
            var transcript           = tr.GetTranscript(2494);

            Assert.IsNotNull(transcript);
        }
        public void SqlTranscriptRepository_Fetches_Terms_against_Student_No_2949()
        {
            ITranscriptRepository tr = new SqlTranscriptRepository();
            var terms = tr.GetTranscript(2949).Terms;

            Assert.IsNotNull(terms);
        }
예제 #3
0
        public void SqlTranscriptRepository_Fetches_Terms_against_DbStudent()
        {
            ITranscriptRepository tr = new SqlTranscriptRepository();
            var terms = tr.GetTranscript(TestConstants.DbStudentUserId).Terms;

            Assert.IsNotNull(terms);
        }
예제 #4
0
        public void SqlTranscriptRepository_Can_Fetch_Student_Transript_Against_A_Valid_DbStudent()
        {
            ITranscriptRepository tr = new SqlTranscriptRepository();
            var transcript           = tr.GetTranscript(TestConstants.DbStudentUserId);

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

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

            Assert.IsNotNull(terms);
        }
        public void TestTranscriptRepository_Returns_Valid_Transcript_Data_For_Student_Id_2949()
        {
            ITranscriptRepository tr = new SqlTranscriptRepository();

            var transcript = tr.GetTranscript(2949);

            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);
        }