コード例 #1
0
        public void buildCourseCommentViewModelTest_HappyPath()
        {
            Enrolled tempEnrolled = _context.Enrolled.Find(1);

            tempEnrolled.course = _context.Courses.Find(tempEnrolled.courseId);
            Comment testComment = new Comment(tempEnrolled);
            CourseCommentViewModel courseCommentViewModel = _viewModelService.buildCourseCommentViewModel(testComment);

            Assert.True(courseCommentViewModel.ratingScore == 90, "rating should be 90");
            Assert.Equal("I like that course", courseCommentViewModel.comment);
            Assert.True(courseCommentViewModel.takenDate.Equals(new DateTime(2019, 9, 6)), "should have same date");
        }