public ActionResult Mentee(MenteeFormModel mentee) { if (ModelState.IsValid) { using (var db = new Mentor_MatchineEntities()) { MenteeManager menteeManager = new MenteeManager(db); menteeManager.AddMenteeFromForm(mentee); var languages = db.Lang.Select(l => new { LangID = l.LanguageID, Language = l.SpokenLang }).ToList(); var nationalities = db.Nationality.Select(l => new { NatID = l.NationalityID, Nationality = l.Nationality1 }).ToList(); ViewBag.Languages = new MultiSelectList(languages, "LangID", "Language"); ViewBag.Nationalities = new SelectList(nationalities, "NatID", "Nationality"); return(View("Mentee")); } } return(View("~/Views/Home/Index.cshtml")); }
// GET: Mentor public MentorController(UserManager user, MentorManager mentor, ScheduleManager schedule, MenteeManager mentee) { _user = user; _schedule = schedule; _mentor = mentor; _mentee = mentee; }
public void AssignMentor() { //Arrange var mockRepo = new MockMenteeRepository(); var manager = new MenteeManager(mockRepo); //Test Data var mentee = new MenteeModel { Category = "Art" }; //Act manager.AddMentee(mentee, 1); manager.AssignMentor(mentee, 11); //Assert Assert.IsTrue(mockRepo.Mentored(mentee.UserId), "Mentor was not assigned"); }
public void AddMentee() { //Arrange var mockRepo = new MockMenteeRepository(); var manager = new MenteeManager(mockRepo); //Test Data var mentee = new MenteeModel { Bio = "My test bio", Address = "Lagos", Gender = "Lagos", }; //Act manager.AddMentee(mentee, 1); //Assert Assert.IsTrue(manager.GetMentee(mentee.UserId) != null, "Mentee was not created"); }
public AdminController(UserManager user, MenteeManager mentee, MentorManager mentor) { _user = user; _mentee = mentee; _mentor = mentor; }