public async Task StudentGeneralInfoGetByPortfolioIdAsync_should_return_general_info() { // Arrange: var studentGeneralInfo = new StudentGeneralInfoModel { Id = integrationTestPortfolioId, UserAccountId = 293945, GradeNumber = 11, FirstName = "ApplicationPlanner.API", AvatarFileName = null, SchoolCountryType = CC.Common.Enum.CountryType.US, HasSeenCartTooltipForTranscriptsInSavedSchoolsMode = true, HasSeenCartTooltipForTranscriptsInSearchMode = true, }; // Act: var result = await _studentRepository.StudentGeneralInfoGetByPortfolioIdAsync(integrationTestPortfolioId); // Assert: Assert.AreEqual(studentGeneralInfo.Id, result.Id); Assert.AreEqual(studentGeneralInfo.UserAccountId, result.UserAccountId); Assert.AreEqual(studentGeneralInfo.GradeNumber, result.GradeNumber); Assert.AreEqual(studentGeneralInfo.FirstName, result.FirstName); Assert.AreEqual(studentGeneralInfo.AvatarFileName, result.AvatarFileName); Assert.AreEqual(studentGeneralInfo.SchoolCountryType, result.SchoolCountryType); Assert.AreEqual(studentGeneralInfo.HasSeenCartTooltipForTranscriptsInSavedSchoolsMode, result.HasSeenCartTooltipForTranscriptsInSavedSchoolsMode); Assert.AreEqual(studentGeneralInfo.HasSeenCartTooltipForTranscriptsInSearchMode, result.HasSeenCartTooltipForTranscriptsInSearchMode); }
public void Test_Init() { _mockStudentGeneralInfo = new StudentGeneralInfoModel { Id = 1234, UserAccountId = 4567, GradeNumber = 11, FirstName = "Fahad", AvatarFileName = "avatar.jpg", SchoolCountryType = CountryType.US }; _mockAvatarService = new Mock <IAvatarService>(); }
public void Test_Init() { _mockStorageAccounts = new Dictionary <CountryType, IStorageAccount> { { CountryType.US, _mockStorageAccount.Object } }; _mockStudentGeneralInfo = new StudentGeneralInfoModel { UserAccountId = 1234, AvatarFileName = "avatar.jpg", SchoolCountryType = CountryType.US }; _mockImageServer = "https://test-image-server.com"; _mockAvatarDirectory = "avatar"; }
public AuthenticatedStudentModel AuthenticatedStudentGetByStudentGeneralInfo(StudentGeneralInfoModel studentGeneralInfo) { return(new AuthenticatedStudentModel { Id = studentGeneralInfo.Id, FirstName = studentGeneralInfo.FirstName, AvatarUrl = string.IsNullOrWhiteSpace(studentGeneralInfo.AvatarFileName) ? string.Empty : _avatarService.GetStudentAvatarUrl(studentGeneralInfo), HasAccessToTranscripts = _gradesWithAccessToTranscripts.Contains(studentGeneralInfo.GradeNumber) && studentGeneralInfo.SchoolCountryType == CountryType.US, globalSetting = new GlobalSettingModel { HasSeenCartTooltipForTranscriptsInSavedSchoolsMode = studentGeneralInfo.HasSeenCartTooltipForTranscriptsInSavedSchoolsMode, HasSeenCartTooltipForTranscriptsInSearchMode = studentGeneralInfo.HasSeenCartTooltipForTranscriptsInSearchMode } }); }
public async Task GetAuthenticatedStudent_should_return_ok() { // Arrange: var studentGeneralInfo = new StudentGeneralInfoModel { }; _mockStudentRepository.Setup(sr => sr.StudentGeneralInfoGetByPortfolioIdAsync(It.IsAny <int>())).ReturnsAsync(studentGeneralInfo); var authenticatedStudent = new AuthenticatedStudentModel { }; _mockStudentService.Setup(ss => ss.AuthenticatedStudentGetByStudentGeneralInfo(It.IsAny <StudentGeneralInfoModel>())).Returns(authenticatedStudent); // Act var actionResult = await CreateController().GetAuthenticatedStudent(); //Assert var contentResult = new OkObjectResult(actionResult); Assert.AreEqual(StatusCodes.Status200OK, contentResult.StatusCode); var response = Result <AuthenticatedStudentModel>(actionResult); Assert.IsNotNull(response); }