Exemplo n.º 1
0
        public void Editprofile_Post()
        {
            var userManager = new UserManager<ApplicationUser>(new TestUserStore());
            ApplicationUser applicationUser = new ApplicationUser()
            {
                Activated = true,
                Email = "*****@*****.**",
                FirstName = "Adarsh",
                LastName = "Vikraman",
                UserName = "******",
                RoleId = 0,
                Id = "402bd590-fdc7-49ad-9728-40efbfe512ec"
            };
            userRepository.Setup(x => x.Get(It.IsAny<Expression<Func<ApplicationUser, bool>>>())).Returns(applicationUser);
            UserProfileFormModel profile = new UserProfileFormModel();

            Mapper.CreateMap<UserProfileFormModel, UserProfile>();
            profile.FirstName ="adarsh";

            AccountController contr = new AccountController(userService, userProfileService, goalService, updateService, commentService, followRequestService, followUserService, securityTokenService,userManager);
            var result = contr.EditProfile(profile) as RedirectToRouteResult;

            Assert.AreEqual("UserProfile", result.RouteValues["action"]);
        }
Exemplo n.º 2
0
        public void Editprofile_Post()
        {
            var userManager = new UserManager<ApplicationUser>(new TestUserStore());
            ApplicationUser applicationUser = getApplicationUser();
            userRepository.Setup(x => x.Get(It.IsAny<Expression<Func<ApplicationUser, bool>>>())).Returns(applicationUser);
            UserProfileFormModel profile = new UserProfileFormModel();

            Mapper.CreateMap<UserProfileFormModel, UserProfile>();
            profile.FirstName ="adarsh";

            AccountController contr = new AccountController(userService, userProfileService, goalService, updateService, commentService, followRequestService, followUserService, securityTokenService,userManager);
            var result = contr.EditProfile(profile) as RedirectToRouteResult;

            Assert.AreEqual("UserProfile", result.RouteValues["action"]);
        }