public IActionResult ViewMentor(long Id)
        {
            //write a code for viewMentor
            MentorDetails mentordetails = new MentorDetails();

            return(View());
        }
        public IActionResult ViewProfile(long MentorId)
        {
            //write a code for viewprofile
            MentorDetails mentor = new MentorDetails();

            return(View());
        }
コード例 #3
0
        public IActionResult Login(Credentials enterdCredentials)
        {
            if (!_loginValidatorService.IsValidPasswordHASH(enterdCredentials))
            {
                return(RedirectToAction("FailedLogin"));
            }

            _session.LoggedUserRole = _loginValidatorService.GetUserRole();
            var credentialId = _loginValidatorService.GetUserCredentialId();

            try
            {
                _session.LoggedUser = _userFinderService.RetrieveUser(_session.LoggedUserRole, credentialId);
                if (_session.LoggedUser.Equals(null))
                {
                    _logger.LogWarning($"Could not retrieve the user with CredentialId = {credentialId}. Such user does not exist.");
                    return(RedirectToAction("FailedLogin"));
                }
                if (_session.LoggedUserRole == Role.Mentor)
                {
                    var classEnrolmentDAO = new ClassEnrolmentDAO();
                    var mentorDetails     = new MentorDetails(classEnrolmentDAO);
                    mentorDetails.GetMentorClassrooms((Mentor)_session.LoggedUser);
                }
                return(RedirectToAction("Welcome", "Profile"));
            }
            catch (ArgumentException e)
            {
                _logger.LogWarning(e.Message);
                return(RedirectToAction("FailedLogin"));
            }
        }
        public IActionResult SelectMentor(long MentorId)
        {
            //write a code for selectmentor
            MentorDetails mentor = new MentorDetails();

            return(View());
        }
        public bool AddProfile(MentorDetails mentor)
        {
            //write a code for Addprofile
            MentorDetails mentordetails = new MentorDetails();

            return(true);
        }
        public void Test_for_AssignRating()
        {
            MentorDetails mentor = new MentorDetails()
            {
                Rating = 5
            };

            var IsAdded = User_Service.AssignRating(mentor.Rating);

            Assert.True(IsAdded);
        }
        public void Test_for_MentorLoginSingIn()
        {
            MentorDetails mentordetail = new MentorDetails()
            {
                UserName = "******",
                Password = "******",
            };

            var signIn = Login_service.SignIn(mentordetail.UserName, mentordetail.Password);

            Assert.True(signIn);
        }
        public void Test_for_MentorEditProfile()
        {
            MentorDetails mentor = new MentorDetails()
            {
                Id = 1,
            };

            var EditmentorProfile = Mentor_service.EditProfile(mentor.Id);
            var GetmentorProfile  = Mentor_service.ViewProfile(mentor.Id);

            Assert.Equal(EditmentorProfile, GetmentorProfile);
        }
コード例 #9
0
        public void Test_for_AssignRating()
        {
            MentorDetails mentor = new MentorDetails()
            {
                Rating = 5
            };

            userService.Setup(repos => repos.AssignRating(mentor.Rating));
            var IsAdded = _userServices.AssignRating(mentor.Rating);

            Assert.True(IsAdded);
        }
コード例 #10
0
        public void BoundaryTest_ForMentorPasswordLength()
        {
            MentorDetails Mentor    = new MentorDetails();
            var           MinLength = 8;
            var           MaxLength = 25;

            //Action
            var actualLength = Mentor.Password.Length;

            //Assert
            Assert.InRange(actualLength, MinLength, MaxLength);
        }
コード例 #11
0
        public void BoundaryTest_ForMentorContactNumber_Length()
        {
            MentorDetails Mentor    = new MentorDetails();
            var           MinLength = 10;
            var           MaxLength = 10;


            //Action
            var actualLength = Mentor.ContactNumber.ToString().Length;

            //Assert
            Assert.InRange(actualLength, MinLength, MaxLength);
        }
コード例 #12
0
        public MentorDetails GetDAL_MentorDetails(bool withTransaction)
        {
            MentorDetails ObjMentorDetails = null;

            if (withTransaction)
            {
                ObjMentorDetails = new MentorDetails(_transaction);
            }
            else
            {
                ObjMentorDetails = new MentorDetails(_connectionString);
            }
            return(ObjMentorDetails);
        }
        public void Test_for_MentorLoginSingup()
        {
            MentorDetails mentordetail = new MentorDetails()
            {
                Role          = "aaa",
                UserName      = "******",
                Password      = "******",
                ContactNumber = 111111111
            };

            var signUp = Login_service.SignUp(mentordetail.Role, mentordetail.UserName, mentordetail.Password, mentordetail.ContactNumber);

            Assert.True(signUp);
        }
コード例 #14
0
        public async Task Testfor_ValidMentorSignin()
        {
            MentorDetails mentordetail = new MentorDetails()
            {
                Role          = "aaa",
                UserName      = "******",
                Password      = "******",
                ContactNumber = 111111111
            };

            mentorService.Setup(repos => repos.SignIn(mentordetail.UserName, mentordetail.Password)).ReturnsAsync(mentordetail);
            var registerdMentor = await _mentorServices.SignIn(mentordetail.UserName, mentordetail.Password);

            Assert.Equal(mentordetail, registerdMentor);;
        }
コード例 #15
0
        public async Task Test_for_MentorSingupAsync()
        {
            MentorDetails mentordetail = new MentorDetails()
            {
                Role          = "aaa",
                UserName      = "******",
                Password      = "******",
                ContactNumber = 111111111
            };

            mentorService.Setup(repos => repos.SignUp(mentordetail)).ReturnsAsync(mentordetail);
            var registeredMentor = await _mentorServices.SignUp(mentordetail);

            Assert.Equal(mentordetail, registeredMentor);
        }
コード例 #16
0
        public async Task Test_for_RoleFordMentorAsync()
        {
            MentorDetails mentor = new MentorDetails()
            {
                Id       = 134,
                UserName = "******",
                Rating   = 5,
                Role     = "Admin"
            };

            mentorService.Setup(repos => repos.ViewMentor(mentor.Id));
            var existmentor = await _mentorServices.ViewMentor(mentor.Id);

            Assert.Equal("Mentor", existmentor.Role);
        }
        public void Test_for_SearchMentor()
        {
            //Arrange
            MentorDetails mentor = new MentorDetails()
            {
                Technology = ".net"
            };

            //Action
            var result          = User_Service.SearchMentor(mentor.Technology);
            var getSearchMentor = User_Service.GetMentorDetails(mentor.Technology);

            //Assert
            Assert.Equal(result, getSearchMentor);
        }
        public async System.Threading.Tasks.Task ExceptionTestForSearchItems()
        {
            //Arrange
            MentorDetails mentor = new MentorDetails()
            {
                Technology = ".net"
            };
            List <MentorDetails> mentorlist = new List <MentorDetails>();

            mentorlist.Add(mentor);

            //Assert
            var ex = await Assert.ThrowsAsync <MentorNotFoundException>(async() => await _userServices.SearchMentor(mentor.Technology));

            Assert.Equal("Mentor Not Found ", ex.Message);
        }
コード例 #19
0
        public async Task Test_for_MentorEditProfileAsync()
        {
            MentorDetails mentor = new MentorDetails()
            {
                Id = 1,
            };


            mentorService.Setup(repos => repos.EditProfile(mentor.Id)).ReturnsAsync(mentor);
            var editedProfile = await _mentorServices.EditProfile(mentor.Id);

            var getprofile = await _mentorServices.ViewProfile(mentor.Id);

            //Assert
            Assert.Equal(getprofile, editedProfile);
            Assert.Equal(mentor, editedProfile);
        }
        public void ExceptionTestForRquiredField()
        {
            //Arrange
            MentorDetails mentor = new MentorDetails()
            {
                UserName      = "******",
                Role          = "aa",
                Password      = "******",
                ContactNumber = 12345678,
            };
            List <MentorDetails> mentorlist = new List <MentorDetails>();

            mentorlist.Add(mentor);

            var ex = Assert.Throws <FieldRequiredException>(() => Login_service.SignUp(mentor.Role, mentor.UserName, mentor.Password, mentor.ContactNumber));

            Assert.Equal("UserName is Could not be empty", ex.Message);
        }
        public void Test_for_AddProfileMentor()
        {
            MentorDetails mentordetails = new MentorDetails()
            {
                Id         = 1,
                Email      = "*****@*****.**",
                Technology = "sss",
                Role       = "bbb",
                Exprience  = 2,
                Facilities = "qqq",
                Fees       = 2000,
                WorkHours  = 4
            };

            var AddProfile = Mentor_service.AddProfile(mentordetails);

            Assert.True(AddProfile);
        }
        public void ExceptionTestForSearchItems()
        {
            //Arrange
            MentorDetails mentor = new MentorDetails()
            {
                Technology = ".net"
            };
            List <MentorDetails> mentorlist = new List <MentorDetails>();

            mentorlist.Add(mentor);



            //Assert
            var ex = Assert.Throws <NotFoundException>(() => User_Service.SearchMentor(mentor.Technology));

            Assert.Equal("Item is Not found in stock", ex.Message);
            //   Assert.th(mentorlist, userServices.SearchMentor(mentor.Technology));
        }
コード例 #23
0
        public void Test_for_SendProposalAsync()
        {
            //Arrange
            User user = new User()
            {
                Id            = 1,
                UserName      = "******",
                FirstName     = "aaa",
                LastName      = "bbb",
                ContactNumber = 1111111111,
                Experience    = 2,
            };
            MentorDetails mentor = new MentorDetails
            {
                Id = 1,
            };

            userService.Setup(repos => repos.SendProposal(user, mentor.Id));
            var result = _userServices.SendProposal(user, mentor.Id);

            Assert.True(result);
        }
コード例 #24
0
        public async Task Test_for_AddProfileMentorAsync()
        {
            MentorDetails mentordetails = new MentorDetails()
            {
                Id         = 1,
                Email      = "*****@*****.**",
                Technology = "sss",
                Role       = "bbb",
                Exprience  = 2,
                Facilities = "qqq",
                Fees       = 2000,
                WorkHours  = 4
            };

            mentorService.Setup(repos => repos.AddProfile(mentordetails)).ReturnsAsync(mentordetails);
            var addedProfile = await _mentorServices.AddProfile(mentordetails);

            var getprofile = await _mentorServices.ViewProfile(mentordetails.Id);

            //Assert
            Assert.Equal(getprofile, addedProfile);
            Assert.Equal(mentordetails, addedProfile);
        }
        public void Test_for_SendProposal()
        {
            //Arrange
            User user = new User()
            {
                Id            = 1,
                UserName      = "******",
                FirstName     = "aaa",
                LastName      = "bbb",
                ContactNumber = 1111111111,
                Experience    = 2,
            };

            MentorDetails mentor = new MentorDetails
            {
                Id = 1,
            };


            var result = User_Service.SendProposal(user, mentor.Id);


            Assert.True(result);
        }
 public Task <MentorDetails> SignUp(MentorDetails mentor)
 {
     throw new NotImplementedException();
 }
 public Task <MentorDetails> AddProfile(MentorDetails mentor)
 {
     throw new NotImplementedException();
 }
コード例 #28
0
        public bool AddProfile(MentorDetails mentor)
        {
            MentorDetails mentordetails = new MentorDetails();

            return(true);
        }
コード例 #29
0
        public MentorDetails ViewMentor(long Id)
        {
            MentorDetails mentordetails = new MentorDetails();

            return(mentordetails);
        }
コード例 #30
0
        public MentorDetails ViewProfile(long MentorId)
        {
            MentorDetails mentor = new MentorDetails();

            return(mentor);
        }