Exemple #1
0
        public void Follow_Request()
        {
            var             userManager     = new UserManager <ApplicationUser>(new TestUserStore());
            MemoryUser      user            = new MemoryUser("adarsh");
            ApplicationUser applicationUser = getApplicationUser();
            var             userContext     = new UserInfo
            {
                UserId         = user.Id,
                DisplayName    = user.UserName,
                UserIdentifier = applicationUser.Email,
                RoleName       = Enum.GetName(typeof(UserRoles), applicationUser.RoleId)
            };
            var testTicket = new FormsAuthenticationTicket(
                1,
                user.Id,
                DateTime.Now,
                DateTime.Now.Add(FormsAuthentication.Timeout),
                false,
                userContext.ToString());



            AccountController controller = new AccountController(userService, userProfileService, goalService, updateService, commentService, followRequestService, followUserService, securityTokenService, userManager);

            principal.SetupGet(x => x.Identity.Name).Returns("adarsh");
            controllerContext.SetupGet(x => x.HttpContext.User).Returns(principal.Object);
            controllerContext.SetupGet(p => p.HttpContext.Request.IsAuthenticated).Returns(true);
            controller.ControllerContext = controllerContext.Object;

            contextBase.SetupGet(x => x.Request).Returns(httpRequest.Object);
            contextBase.SetupGet(x => x.Response).Returns(httpResponse.Object);
            genericPrincipal.Setup(x => x.Identity).Returns(identity.Object);

            contextBase.SetupGet(a => a.Response.Cookies).Returns(new HttpCookieCollection());

            var formsAuthentication = new DefaultFormsAuthentication();



            formsAuthentication.SetAuthCookie(contextBase.Object, testTicket);

            HttpCookie authCookie = contextBase.Object.Response.Cookies[FormsAuthentication.FormsCookieName];

            var ticket         = formsAuthentication.Decrypt(authCookie.Value);
            var goalsetterUser = new SocialGoalUser(ticket);

            string[] userRoles = { goalsetterUser.RoleName };

            principal.Setup(x => x.Identity).Returns(goalsetterUser);

            userRepository.Setup(x => x.Get(It.IsAny <Expression <Func <ApplicationUser, bool> > >())).Returns(applicationUser);
            Mapper.CreateMap <FollowRequestFormModel, FollowRequest>();


            var result = controller.FollowRequest("402bd590-fdc7-49ad-9728-40efbfe512ec") as RedirectToRouteResult;

            Assert.AreEqual("UserProfile", result.RouteValues["action"]);
        }
Exemple #2
0
        public void Edit_Personal_Info()
        {
            var             userManager     = new UserManager <ApplicationUser>(new TestUserStore());
            MemoryUser      user            = new MemoryUser("adarsh");
            ApplicationUser applicationUser = getApplicationUser();
            var             userContext     = new UserInfo
            {
                UserId         = user.Id,
                DisplayName    = user.UserName,
                UserIdentifier = applicationUser.Email,
                RoleName       = Enum.GetName(typeof(UserRoles), applicationUser.RoleId)
            };
            var testTicket = new FormsAuthenticationTicket(
                1,
                user.Id,
                DateTime.Now,
                DateTime.Now.Add(FormsAuthentication.Timeout),
                false,
                userContext.ToString());
            AccountController controller = new AccountController(userService, userProfileService, goalService, updateService, commentService, followRequestService, followUserService, securityTokenService, userManager);

            principal.SetupGet(x => x.Identity.Name).Returns("adarsh");
            controllerContext.SetupGet(x => x.HttpContext.User).Returns(principal.Object);
            controllerContext.SetupGet(p => p.HttpContext.Request.IsAuthenticated).Returns(true);
            controller.ControllerContext = controllerContext.Object;
            contextBase.SetupGet(x => x.Request).Returns(httpRequest.Object);
            contextBase.SetupGet(x => x.Response).Returns(httpResponse.Object);
            genericPrincipal.Setup(x => x.Identity).Returns(identity.Object);
            contextBase.SetupGet(a => a.Response.Cookies).Returns(new HttpCookieCollection());
            var formsAuthentication = new DefaultFormsAuthentication();

            formsAuthentication.SetAuthCookie(contextBase.Object, testTicket);
            HttpCookie authCookie     = contextBase.Object.Response.Cookies[FormsAuthentication.FormsCookieName];
            var        ticket         = formsAuthentication.Decrypt(authCookie.Value);
            var        goalsetterUser = new SocialGoalUser(ticket);

            string[] userRoles = { goalsetterUser.RoleName };
            principal.Setup(x => x.Identity).Returns(goalsetterUser);
            UserProfile grpuser = new UserProfile()
            {
                UserId  = "402bd590-fdc7-49ad-9728-40efbfe512ec",
                Address = "t",
                City    = "t",
                State   = "*****@*****.**",
            };

            userProfileRepository.Setup(x => x.Get(It.IsAny <Expression <Func <UserProfile, bool> > >())).Returns(grpuser);
            Mapper.CreateMap <UserProfile, UserProfileFormModel>();

            PartialViewResult result = controller.EditPersonalInfo() as PartialViewResult;

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(typeof(UserProfileFormModel), result.ViewData.Model, "WrongType");
            var data = result.ViewData.Model as UserProfileFormModel;

            Assert.AreEqual("t", data.Address);
        }
Exemple #3
0
        public void Image_Upload_GetView()
        {
            var             userManager     = new UserManager <ApplicationUser>(new TestUserStore());
            MemoryUser      user            = new MemoryUser("adarsh");
            ApplicationUser applicationUser = new ApplicationUser()
            {
                Activated = true,
                Email     = "*****@*****.**",
                FirstName = "Adarsh",
                LastName  = "Vikraman",
                RoleId    = 0
            };
            var userContext = new UserInfo
            {
                UserId         = user.Id,
                DisplayName    = user.UserName,
                UserIdentifier = applicationUser.Email,
                RoleName       = Enum.GetName(typeof(UserRoles), applicationUser.RoleId)
            };
            var testTicket = new FormsAuthenticationTicket(
                1,
                user.Id,
                DateTime.Now,
                DateTime.Now.Add(FormsAuthentication.Timeout),
                false,
                userContext.ToString());
            AccountController controller = new AccountController(userService, userProfileService, goalService, updateService, commentService, followRequestService, followUserService, securityTokenService, userManager);

            principal.SetupGet(x => x.Identity.Name).Returns("adarsh");
            controllerContext.SetupGet(x => x.HttpContext.User).Returns(principal.Object);
            controllerContext.SetupGet(p => p.HttpContext.Request.IsAuthenticated).Returns(true);
            controller.ControllerContext = controllerContext.Object;
            contextBase.SetupGet(x => x.Request).Returns(httpRequest.Object);
            contextBase.SetupGet(x => x.Response).Returns(httpResponse.Object);
            genericPrincipal.Setup(x => x.Identity).Returns(identity.Object);
            contextBase.SetupGet(a => a.Response.Cookies).Returns(new HttpCookieCollection());
            var formsAuthentication = new DefaultFormsAuthentication();

            formsAuthentication.SetAuthCookie(contextBase.Object, testTicket);
            HttpCookie authCookie     = contextBase.Object.Response.Cookies[FormsAuthentication.FormsCookieName];
            var        ticket         = formsAuthentication.Decrypt(authCookie.Value);
            var        goalsetterUser = new SocialGoalUser(ticket);

            string[] userRoles = { goalsetterUser.RoleName };
            principal.Setup(x => x.Identity).Returns(goalsetterUser);
            userRepository.Setup(x => x.Get(It.IsAny <Expression <Func <ApplicationUser, bool> > >())).Returns(applicationUser);
            PartialViewResult result = controller.ImageUpload() as PartialViewResult;

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(typeof(UploadImageViewModel), result.ViewData.Model, "Wrong model");
            var data = result.ViewData.Model as UploadImageViewModel;

            Assert.AreEqual(null, data.LocalPath, "not matching");
        }
        public void WhenDecryptingAuthenticationTicket_TheReturnsTicket()
        {
            var    formsAuth       = new DefaultFormsAuthentication();
            var    ticket          = new FormsAuthenticationTicket("test", false, 10);
            string encryptedTicket = FormsAuthentication.Encrypt(ticket);

            var recoveredTicket = formsAuth.Decrypt(encryptedTicket);

            Assert.NotNull(recoveredTicket);
            Assert.Equal(ticket.Name, recoveredTicket.Name);
            Assert.Equal(ticket.Expiration, recoveredTicket.Expiration);
            Assert.Equal(ticket.IsPersistent, recoveredTicket.IsPersistent);
            Assert.Equal(ticket.IssueDate, recoveredTicket.IssueDate);
        }
Exemple #5
0
        private void PostAuthenticateRequestHandler(object sender, EventArgs e)
        {
            HttpCookie authCookie = this.Context.Request.Cookies[FormsAuthentication.FormsCookieName];

            if (authCookie != null && !string.IsNullOrEmpty(authCookie.Value))
            {
                //var formsAuthentication = DependencyResolver.Current.GetService<IFormsAuthentication>();
                IFormsAuthentication formsAuthentication = new DefaultFormsAuthentication();

                var ticket = formsAuthentication.Decrypt(authCookie.Value);
                try
                {
                    var mvcUser = new MVCUser(ticket);
                    this.Context.User = new GenericPrincipal(mvcUser, null);
                    formsAuthentication.SetAuthCookie(this.Context, ticket);
                }
                catch
                {
                    //清掉Session重登
                    formsAuthentication.Signout();
                    HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(string.Empty), null);
                }
            }
        }
Exemple #6
0
        public void Followings_list()
        {
            var             userManager     = new UserManager <ApplicationUser>(new TestUserStore());
            MemoryUser      user            = new MemoryUser("adarsh");
            ApplicationUser applicationUser = getApplicationUser();
            var             userContext     = new UserInfo
            {
                UserId         = user.Id,
                DisplayName    = user.UserName,
                UserIdentifier = applicationUser.Email,
                RoleName       = Enum.GetName(typeof(UserRoles), applicationUser.RoleId)
            };
            var testTicket = new FormsAuthenticationTicket(
                1,
                user.Id,
                DateTime.Now,
                DateTime.Now.Add(FormsAuthentication.Timeout),
                false,
                userContext.ToString());



            AccountController controller = new AccountController(userService, userProfileService, goalService, updateService, commentService, followRequestService, followUserService, securityTokenService, userManager);

            controllerContext.SetupGet(x => x.HttpContext.User).Returns(principal.Object);
            controllerContext.SetupGet(p => p.HttpContext.Request.IsAuthenticated).Returns(true);
            controller.ControllerContext = controllerContext.Object;

            contextBase.SetupGet(x => x.Request).Returns(httpRequest.Object);
            contextBase.SetupGet(x => x.Response).Returns(httpResponse.Object);
            genericPrincipal.Setup(x => x.Identity).Returns(identity.Object);

            contextBase.SetupGet(a => a.Response.Cookies).Returns(new HttpCookieCollection());

            var formsAuthentication = new DefaultFormsAuthentication();



            formsAuthentication.SetAuthCookie(contextBase.Object, testTicket);

            HttpCookie authCookie = contextBase.Object.Response.Cookies[FormsAuthentication.FormsCookieName];

            var ticket         = formsAuthentication.Decrypt(authCookie.Value);
            var goalsetterUser = new SocialGoalUser(ticket);

            principal.Setup(x => x.Identity).Returns(goalsetterUser);

            IEnumerable <FollowUser> fakeuser = new List <FollowUser> {
                new FollowUser {
                    FollowUserId = 1, Accepted = false, FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ed",
                },
                new FollowUser {
                    FollowUserId = 2, Accepted = false, FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ee"
                },
            };

            followUserRepository.Setup(x => x.GetMany(It.IsAny <Expression <Func <FollowUser, bool> > >())).Returns(fakeuser);

            Mapper.CreateMap <ApplicationUser, FollowersViewModel>();


            ViewResult result = controller.Followings() as ViewResult;

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(typeof(IEnumerable <FollowingViewModel>), result.ViewData.Model, "WrongType");
            var data = result.ViewData.Model as IEnumerable <FollowingViewModel>;

            Assert.AreEqual(2, data.Count());
        }
Exemple #7
0
        public void UserProfile()
        {
            var             userManager     = new UserManager <ApplicationUser>(new TestUserStore());
            MemoryUser      user            = new MemoryUser("adarsh");
            ApplicationUser applicationUser = getApplicationUser();
            var             userContext     = new UserInfo
            {
                UserId         = user.Id,
                DisplayName    = user.UserName,
                UserIdentifier = applicationUser.Email,
                RoleName       = Enum.GetName(typeof(UserRoles), applicationUser.RoleId)
            };
            var testTicket = new FormsAuthenticationTicket(
                1,
                user.Id,
                DateTime.Now,
                DateTime.Now.Add(FormsAuthentication.Timeout),
                false,
                userContext.ToString());

            userRepository.Setup(x => x.Get(It.IsAny <Expression <Func <ApplicationUser, bool> > >())).Returns(applicationUser);
            AccountController controller = new AccountController(userService, userProfileService, goalService, updateService, commentService, followRequestService, followUserService, securityTokenService, userManager);

            principal.SetupGet(x => x.Identity.Name).Returns("adarsh");
            controllerContext.SetupGet(x => x.HttpContext.User).Returns(principal.Object);
            controllerContext.SetupGet(p => p.HttpContext.Request.IsAuthenticated).Returns(true);
            controller.ControllerContext = controllerContext.Object;
            contextBase.SetupGet(x => x.Request).Returns(httpRequest.Object);
            contextBase.SetupGet(x => x.Response).Returns(httpResponse.Object);
            genericPrincipal.Setup(x => x.Identity).Returns(identity.Object);
            contextBase.SetupGet(a => a.Response.Cookies).Returns(new HttpCookieCollection());
            var formsAuthentication = new DefaultFormsAuthentication();

            formsAuthentication.SetAuthCookie(contextBase.Object, testTicket);
            HttpCookie authCookie     = contextBase.Object.Response.Cookies[FormsAuthentication.FormsCookieName];
            var        ticket         = formsAuthentication.Decrypt(authCookie.Value);
            var        goalsetterUser = new SocialGoalUser(ticket);

            string[] userRoles = { goalsetterUser.RoleName };
            principal.Setup(x => x.Identity).Returns(goalsetterUser);
            UserProfile prfil = new UserProfile()
            {
                FirstName   = "Adarsh",
                LastName    = "Vikraman",
                DateOfBirth = DateTime.Now,
                Gender      = true,
                Address     = "a",
                City        = "a",
                State       = "a",
                Country     = "a",
                ZipCode     = 2344545,
                ContactNo   = 1223344556,
                UserId      = "402bd590-fdc7-49ad-9728-40efbfe512ec"
            };

            userProfileRepository.Setup(x => x.Get(It.IsAny <Expression <Func <UserProfile, bool> > >())).Returns(prfil);
            IEnumerable <FollowRequest> fake = new List <FollowRequest> {
                new FollowRequest {
                    FollowRequestId = 1, FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ed"
                },
                new FollowRequest {
                    FollowRequestId = 2, FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ee"
                },
            };

            followRequestRepository.Setup(x => x.GetMany(It.IsAny <Expression <Func <FollowRequest, bool> > >())).Returns(fake);
            IEnumerable <FollowUser> fakeuser = new List <FollowUser> {
                new FollowUser {
                    FollowUserId = 1, Accepted = false, FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ed"
                },
                new FollowUser {
                    FollowUserId = 2, Accepted = false, FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ee"
                },
            };

            followUserRepository.Setup(x => x.GetMany(It.IsAny <Expression <Func <FollowUser, bool> > >())).Returns(fakeuser);
            ViewResult result = controller.UserProfile("402bd590-fdc7-49ad-9728-40efbfe512ec") as ViewResult;

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(typeof(UserProfileViewModel), result.ViewData.Model, "WrongType");
            var data = result.ViewData.Model as UserProfileViewModel;

            Assert.AreEqual("adarsh", data.UserName);
        }
Exemple #8
0
        public void Add_GroupUser()
        {
            Guid          guidToken = Guid.NewGuid();
            SecurityToken token     = new SecurityToken()
            {
                SecurityTokenId = 1,
                Token           = guidToken,
                ActualID        = 1
            };

            securityTokenRepository.Setup(x => x.Get(It.IsAny <Expression <Func <SecurityToken, bool> > >())).Returns(token);

            MemoryUser      user            = new MemoryUser("adarsh");
            ApplicationUser applicationUser = getApplicationUser();
            var             userContext     = new UserInfo
            {
                UserId         = user.Id,
                DisplayName    = user.UserName,
                UserIdentifier = applicationUser.Email,
                RoleName       = Enum.GetName(typeof(UserRoles), applicationUser.RoleId)
            };
            var testTicket = new FormsAuthenticationTicket(
                1,
                user.Id,
                DateTime.Now,
                DateTime.Now.Add(FormsAuthentication.Timeout),
                false,
                userContext.ToString());



            EmailRequestController controller = new EmailRequestController(securityTokenService, groupUserService, supportService, groupInvitationService);

            controllerContext.SetupGet(x => x.HttpContext.User).Returns(principal.Object);
            controllerContext.SetupGet(p => p.HttpContext.Request.IsAuthenticated).Returns(true);
            controller.ControllerContext = controllerContext.Object;

            contextBase.SetupGet(x => x.Request).Returns(httpRequest.Object);
            contextBase.SetupGet(x => x.Response).Returns(httpResponse.Object);
            genericPrincipal.Setup(x => x.Identity).Returns(identity.Object);

            contextBase.SetupGet(a => a.Response.Cookies).Returns(new HttpCookieCollection());

            var formsAuthentication = new DefaultFormsAuthentication();



            formsAuthentication.SetAuthCookie(contextBase.Object, testTicket);

            HttpCookie authCookie = contextBase.Object.Response.Cookies[FormsAuthentication.FormsCookieName];

            var ticket         = formsAuthentication.Decrypt(authCookie.Value);
            var goalsetterUser = new SocialGoalUser(ticket);

            principal.Setup(x => x.Identity).Returns(goalsetterUser);

            var httprequest  = new HttpRequest("", "http://yoursite/", "");
            var stringWriter = new StringWriter();
            var httpResponce = new HttpResponse(stringWriter);
            var httpContext  = new HttpContext(httprequest, httpResponce);

            var sessionContainer = new HttpSessionStateContainer("id",
                                                                 new SessionStateItemCollection(),
                                                                 new HttpStaticObjectsCollection(),
                                                                 10,
                                                                 true,
                                                                 HttpCookieMode.AutoDetect,
                                                                 SessionStateMode.InProc,
                                                                 false);

            httpContext.Items["AspSession"] = typeof(HttpSessionState).GetConstructor(
                BindingFlags.NonPublic | BindingFlags.Instance,
                null, CallingConventions.Standard,
                new[] { typeof(HttpSessionStateContainer) },
                null)
                                              .Invoke(new object[] { sessionContainer });

            HttpContext.Current = httpContext;
            //HttpContext.Current.Request.Session["somevalue"];

            controller.TempData            = tempData.Object;
            controller.TempData["grToken"] = guidToken;
            var result = controller.AddGroupUser() as RedirectToRouteResult;

            Assert.AreEqual("Index", result.RouteValues["action"]);
        }
        public void Index_If_AjaxRequest_IsNull()
        {
            MemoryUser      user            = new MemoryUser("adarsh");
            ApplicationUser applicationUser = getApplicationUser();
            var             userContext     = new UserInfo
            {
                UserId         = user.Id,
                DisplayName    = user.UserName,
                UserIdentifier = applicationUser.Email,
                RoleName       = Enum.GetName(typeof(UserRoles), applicationUser.RoleId)
            };
            var testTicket = new FormsAuthenticationTicket(
                1,
                user.Id,
                DateTime.Now,
                DateTime.Now.Add(FormsAuthentication.Timeout),
                false,
                userContext.ToString());

            userRepository.Setup(x => x.Get(It.IsAny <Expression <Func <ApplicationUser, bool> > >())).Returns(applicationUser);

            NotificationController controller = new NotificationController(goalService, updateService, commentService, groupInvitationService, supportInvitationService, followRequestService, userService);


            principal.SetupGet(x => x.Identity.Name).Returns("adarsh");
            controllerContext.SetupGet(x => x.HttpContext.User).Returns(principal.Object);
            controllerContext.SetupGet(p => p.HttpContext.Request.IsAuthenticated).Returns(true);
            controller.ControllerContext = controllerContext.Object;

            contextBase.SetupGet(x => x.Request).Returns(httpRequest.Object);
            contextBase.SetupGet(x => x.Response).Returns(httpResponse.Object);
            genericPrincipal.Setup(x => x.Identity).Returns(identity.Object);

            contextBase.SetupGet(a => a.Response.Cookies).Returns(new HttpCookieCollection());

            var formsAuthentication = new DefaultFormsAuthentication();



            formsAuthentication.SetAuthCookie(contextBase.Object, testTicket);

            HttpCookie authCookie = contextBase.Object.Response.Cookies[FormsAuthentication.FormsCookieName];

            var ticket         = formsAuthentication.Decrypt(authCookie.Value);
            var goalsetterUser = new MuhendislerBuradaUser(ticket);

            string[] userRoles = { goalsetterUser.RoleName };

            principal.Setup(x => x.Identity).Returns(goalsetterUser);
            IEnumerable <GroupInvitation> groupInvitation = new List <GroupInvitation> {
                new GroupInvitation {
                    Accepted = false, ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ed", FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec"
                },
                new GroupInvitation {
                    Accepted = false, ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ed",
                },
                new GroupInvitation {
                    Accepted = false, ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ee"
                },
            }.AsEnumerable();

            groupInvitationRepository.Setup(x => x.GetAll()).Returns(groupInvitation);

            IEnumerable <SupportInvitation> supportInvitation = new List <SupportInvitation> {
                new SupportInvitation {
                    Accepted = false, ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ed", FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec"
                },
                new SupportInvitation {
                    Accepted = false, ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ed"
                },
                new SupportInvitation {
                    Accepted = false, ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ee"
                },
            }.AsEnumerable();

            supportInvitationRepository.Setup(x => x.GetAll()).Returns(supportInvitation);

            IEnumerable <FollowRequest> followInvitation = new List <FollowRequest> {
                new FollowRequest {
                    Accepted = false, ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ed", FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec"
                },
                new FollowRequest {
                    Accepted = false, ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ed"
                },
                new FollowRequest {
                    Accepted = false, ToUserId = "402bd590-fdc7-49ad-9728-40efbfe512ec", FromUserId = "402bd590-fdc7-49ad-9728-40efbfe512ee"
                },
            }.AsEnumerable();

            followRequestRepository.Setup(x => x.GetMany(It.IsAny <Expression <Func <FollowRequest, bool> > >())).Returns(followInvitation);
            Mapper.CreateMap <GroupInvitation, NotificationViewModel>();
            Mapper.CreateMap <SupportInvitation, NotificationViewModel>();
            Mapper.CreateMap <FollowRequest, NotificationViewModel>();
            ViewResult result = controller.Index(1) as ViewResult;

            Assert.IsNotNull(result);
        }