public void TestTranscriptService_Can_Fetch_Student_Transript_Against_Test_Student() { ITranscriptService tr = new TranscriptService(new TestTranscriptRepository()); var transcript = tr.GetTranscript(1); Assert.IsNotNull(transcript); }
public ActionResult Transcript() { try { ITranscriptService transcriptService = new TranscriptService(); var transcript = transcriptService.GetTranscript(StudentNo); return(View(transcript)); } catch (Exception ex) { //ViewData["ErrorMessage"] = ex.Message; View("Result\\error").ExecuteResult(this.ControllerContext); return(null); } }
public ActionResult GradeHistory() { try { ITranscriptService transcriptService = new TranscriptService(); var transcript = transcriptService.GetTranscript(StudentNo); return(View(transcript)); } catch (Exception ex) { //ViewData["ErrorMessage"] = ex.Message; Response.Redirect("../User/Result/error"); return(null); } }
public ActionResult AcademicReviewByTerm() { try { ITranscriptService transcriptService = new TranscriptService(); var transcript = transcriptService.GetTranscript(StudentNo); return(View(transcript)); } catch (Exception ex) { _logger.Error("Exception Occurred. StudentNo: " + StudentNo, ex); Response.Redirect(AppHelper.SharedUrl("Reply/Error")); return(null); } }
public void TranscriptService_Returns_Not_Null_Data_against_Valid_DbStudent() { ITranscriptService tr = new TranscriptService(); Transcript t = tr.GetTranscript(TestConstants.DbStudentUserId); Assert.IsNotNull(t.Cgpa); Assert.IsNotNull(t.Terms); foreach (var term in t.Terms) { // Database has entries where this field is null. Assert.IsNotNull(term.Courses); } Assert.IsNotNull(t.UnitsAttempted); Assert.IsNotNull(t.UnitsCompleted); Assert.IsNotNull(t.UnitsInProgress); }
public void TestTranscriptService_Returns_Valid_Transcript_Data_For_Test_Student() { ITranscriptService tr = new TranscriptService(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); }
public void TranscriptService_Returns_Not_Null_Data_against_DbStudent_No_2494() { ITranscriptService tr = new TranscriptService(); Transcript t = tr.GetTranscript(2494); Assert.IsNotNull(t.Cgpa); Assert.IsNotNull(t.Terms); foreach (var term in t.Terms) { // Database has entries where this field is null. //Assert.IsNotNull(term.StartDate); Assert.IsNotNull(term.Courses); } Assert.IsNotNull(t.UnitsAttempted); Assert.IsNotNull(t.UnitsCompleted); Assert.IsNotNull(t.UnitsInProgress); }
public IEnumerable <TranscriptVM> GetStudentTranscript(int StudentId, int ClassId) { var transcripts = service.GetTranscript(StudentId, ClassId); return(transcripts.Select(t => BaseVM <object> .ToModel <TranscriptVM>(t))); }