예제 #1
0
        public ActionResult Index()
        {
            var user = User.Identity.GetUserIdentity();

            var model = _mentee.GetMentee(user.UserId);

            return(View(model));
        }
예제 #2
0
        public ActionResult Assign(int userId)
        {
            //Get Mentee
            var mentee = _mentee.GetMentee(userId);
            var model  = new AssignViewModel
            {
                Mentee = mentee
            };

            //Get Mentor List in that category
            var mentors = _mentor.GetMentorsByCategory(mentee.Category);

            ViewBag.UserId = new SelectList(mentors, "UserId", "User.Name", model.Mentor.UserId);

            //model.Mentors = GetSelectListItems(mentors);

            //return model
            return(View(model));
        }
예제 #3
0
 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");
 }