Exemplo n.º 1
0
        public void buildRateCourseViewModelTest_HappyPath()
        {
            Enrolled            enrolled            = _context.Enrolled.Find(9);
            Course              course              = _context.Courses.Find(enrolled.courseId);
            RateCourseViewModel rateCourseViewModel = _viewModelService.buildRateCourseViewModel(enrolled, course);

            Assert.True(rateCourseViewModel.EnrollId == 9);
            Assert.Null(rateCourseViewModel.Rating);
            Assert.Null(rateCourseViewModel.Comment);
            Assert.Equal("COMP 3350", rateCourseViewModel.CourseName);
            Assert.Equal("Software Engineer 1", rateCourseViewModel.courseDescription);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Rate(int eid)
        {
            Enrolled rate = await _enrollSerivce.getEnrollAsync(eid);

            Course course = await _courseService.getCourseAsync(rate.courseId);

            RateCourseViewModel vm = _viewModelSerivce.buildRateCourseViewModel(rate, course);

            return(View(vm));
        }