예제 #1
0
        public void CalculateGPA_WhenCalled_VerifyCommandForSumBeingCalled()
        {
            var commandForSum = String.Format("SELECT SUM(Total) FROM StudentCourses where StudentId = {0}", studentId);

            _studentService.CalculateGPA(studentId);
            _myDbAccess.Verify(db => db.SumOfTotal(commandForSum, _connectionString), Times.Once);
        }
예제 #2
0
        protected void Cal_GPA(object sender, EventArgs e)
        {
            var studentId = Convert.ToInt32(Session["StudentId"]);
            var GPA       = studentService.CalculateGPA(studentId);
            var str       = String.Format("{0:F1}", GPA);

            GPALbl.Visible = true;
            GPALbl.Text    = "GPA : " + str;
        }