public void buildProfileViewModelTest_HappyPath() { Student student = _context.Students.Find(1); ProfileViewModel profileViewModel = _viewModelService.buildProfileViewModel(student); Assert.True(profileViewModel.thisStudent.studentId == 1, "student id should equal 1"); Assert.Equal("John Braico", profileViewModel.thisStudent.name); Assert.Equal("Computer Science", profileViewModel.majorName); Assert.True(profileViewModel.cViewModels.Count() == 0, "student should have 0 erolls"); Assert.True(profileViewModel.remainingCreditHours == 24, "student should have 24 credit hours remaining"); }
public async Task <IActionResult> Index() { //get instance of current StudentUser oboject var curUser = await _userManager.GetUserAsync(this.User); Student student = await _studentSerivce.getStudentAsync(curUser.StudentId); ProfileViewModel thisView = _viewModelSerivce.buildProfileViewModel(student); return(View(thisView)); }