Beispiel #1
0
        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 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);
        }
Beispiel #3
0
        public void TranscriptService_SqlTranscriptRepository_Fetches_Terms_against_DbStudent()
        {
            var tr = new SqlTranscriptRepository();
            var ts = new TranscriptService(tr);

            var terms = tr.GetTranscript(TestConstants.DbStudentUserId).Terms;

            Assert.IsNotNull(terms);
        }
Beispiel #4
0
        public void TranscriptService_TestTranscriptRepository_Fetches_Terms_against_Test_Student()
        {
            var tr = new TestTranscriptRepository();
            var ts = new TranscriptService(tr);

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

            Assert.IsNotNull(terms);
        }
Beispiel #5
0
        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);
            }
        }
Beispiel #6
0
        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);
            }
        }
Beispiel #7
0
        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);
            }
        }
Beispiel #8
0
        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);
        }
Beispiel #9
0
        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);
        }
Beispiel #11
0
 public BatchController(
     IOptions <ManagerConfiguration> managerConfiguration,
     FileService fileService,
     PathService pathService,
     ModuleConfigurator moduleConfigurator,
     TranscriptService transcriptService,
     MediaService mediaService,
     ClipService clipService,
     FolderService folderService)
 {
     this.FileService          = fileService;
     this.PathService          = pathService;
     this.ManagerConfiguration = managerConfiguration;
     this.ModuleConfigurator   = moduleConfigurator;
     this.TranscriptService    = transcriptService;
     this.MediaService         = mediaService;
     this.ClipService          = clipService;
     this.FolderService        = folderService;
 }
Beispiel #12
0
        private void transcriptButton_Click(object sender, RoutedEventArgs e)
        {
            TranscriptService _transcriptService = new TranscriptService();

            _transcriptService.CreateTranscript(_grade);
        }