public DataTable GetStudentByStudentCourses() { var studentCode = Convert.ToString(Session["StudentCode"]); var data = studentService.ShowStudentCourses(studentCode); return(data); }
public void ShowStudentCourses_WhenCalled_VerifyTheRightCommandBeingCalled() { var command = String.Format("Select sb.CourseName, sc.Attendence, sc.Quiz, sc.HomeWork,sc.Research,sc.LabPractice,sc.FinalExam from student s left join StudentCourses sc on s.StudentId = sc.StudentId inner join Subject sb on sb.Id = sc.CourseId where s.StudentCode = '{0}'", studentCode); _studentService.ShowStudentCourses(studentCode); _myDbAccess.Verify(db => db.Select(command, _connectionString), Times.Once); }