public static SetModel CreateNewWith(Data.Entities.Student student, string profilePhotoUrl, List<SessionListItemModel> sessions, SessionListItemModel session, List<Section.SectionListItemModel> currentlyEnrolledSections) { var setModel = new SetModel { StudentName = String.Join(" ", student.FirstName, student.LastSurname), StudentUsi = student.StudentUSI, ProfilePhotoUrl = profilePhotoUrl, Sessions = sessions, Session = session.SessionId, BeginDate = session.BeginDate, EndDate = session.EndDate, CurrentlyEnrolledSections = currentlyEnrolledSections }; return setModel; }
public static SetModel CreateNewWith(Data.Entities.Student student, string profilePhotoUrl, List <SessionListItemModel> sessions, SessionListItemModel session, List <Section.SectionListItemModel> currentlyEnrolledSections) { var setModel = new SetModel { StudentName = String.Join(" ", student.FirstName, student.LastSurname), StudentUsi = student.StudentUSI, ProfilePhotoUrl = profilePhotoUrl, Sessions = sessions, Session = session.SessionId, BeginDate = session.BeginDate, EndDate = session.EndDate, CurrentlyEnrolledSections = currentlyEnrolledSections }; return(setModel); }
public void HaveEnteredValidInputForAllFields() { _setModel = new SetScheduleModelBuilder().WithStudent(_student).Build(); _schedulePage.AddStudentToSection(_setModel); }
public virtual JsonResult ScheduleStudent(SetModel setModel) { if (!ModelState.IsValid) { var errors = ModelState.Values.SelectMany(v => v.Errors).ToList(); return Json(new {errors}, JsonRequestBehavior.AllowGet); } var studentSectionAssociation = _setModelToStudentSectionAssociationMapper.Build(setModel); _genericRepository.Add(studentSectionAssociation); _genericRepository.Save(); var sectionListItem = _studentSectionAssociationToSectionListItemModelMapper.Build(studentSectionAssociation); return Json(sectionListItem, JsonRequestBehavior.AllowGet); }
public void MultipleSectionsAreAssignedToTheStudent() { _schedulePage.AddStudentToSection(new SetScheduleModelBuilder().WithStudent(_student).Build()); _setModelToBeRemoved = new SetScheduleModelBuilder().WithStudent(_student).WithSectionId(10).Build(); _schedulePage.AddStudentToSection(_setModelToBeRemoved); }
private void Setup() { _genericRepository = Substitute.For<IGenericRepository>(); _validator = new SetModelValidator(_genericRepository); _setModel = new SetScheduleModelBuilder().Build(); }