コード例 #1
0
 public NotificationController(IGoalService goalService, IUpdateService updateService, ICommentService commentService, IGroupInvitationService groupInvitationService, ISupportInvitationService supportInvitationService, IFollowRequestService followRequestService, IUserService userService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.updateService = updateService;
     this.groupInvitationService = groupInvitationService;
     this.commentService = commentService;
     this.followRequestService = followRequestService;
     this.userService = userService;
 }
コード例 #2
0
 public NotificationController(IGoalService goalService, IUpdateService updateService, ICommentService commentService, IGroupInvitationService groupInvitationService, ISupportInvitationService supportInvitationService, IFollowRequestService followRequestService, IUserService userService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.updateService            = updateService;
     this.groupInvitationService   = groupInvitationService;
     this.commentService           = commentService;
     this.followRequestService     = followRequestService;
     this.userService = userService;
 }
コード例 #3
0
ファイル: SupportService.cs プロジェクト: ckaeser/SocialGoal
        public void CreateUserSupport(Support support, ISupportInvitationService supportInvitationService)
        {
            var oldUser = _supportRepository.GetMany(g => g.UserId == support.UserId && g.SupportId == support.SupportId);

            if (oldUser.Count() == 0)
            {
                _supportRepository.Add(support);
                SaveSupport();
            }
            supportInvitationService.AcceptInvitation(support.GoalId, support.UserId);
        }
コード例 #4
0
ファイル: GoalController.cs プロジェクト: ckaeser/SocialGoal
 public GoalController(IGoalService goalService, IMetricService metricService, IFocusService focusService, ISupportService supportService, IUpdateService updateService, ICommentService commentService, IUserService userService, ISecurityTokenService securityTokenService, ISupportInvitationService supportInvitationService, IGoalStatusService goalStatusService, ICommentUserService commentUserService, IUpdateSupportService updateSupportService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.metricService            = metricService;
     this.focusService             = focusService;
     this.supportService           = supportService;
     this.updateService            = updateService;
     this.commentService           = commentService;
     this.userService          = userService;
     this.securityTokenService = securityTokenService;
     this.goalStatusService    = goalStatusService;
     this.commentUserService   = commentUserService;
     this.updateSupportService = updateSupportService;
 }
コード例 #5
0
 public GoalController(IGoalService goalService, IMetricService metricService, IFocusService focusService, ISupportService supportService, IUpdateService updateService, ICommentService commentService, IUserService userService, ISecurityTokenService securityTokenService, ISupportInvitationService supportInvitationService, IGoalStatusService goalStatusService, ICommentUserService commentUserService, IUpdateSupportService updateSupportService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.metricService = metricService;
     this.focusService = focusService;
     this.supportService = supportService;
     this.updateService = updateService;
     this.commentService = commentService;
     this.userService = userService;
     this.securityTokenService = securityTokenService;
     this.goalStatusService = goalStatusService;
     this.commentUserService = commentUserService;
     this.updateSupportService = updateSupportService;
 }
コード例 #6
0
        public void SetUp()
        {
            groupInvitationRepository   = new Mock <IGroupInvitationRepository>();
            supportInvitationRepository = new Mock <ISupportInvitationRepository>();
            followRequestRepository     = new Mock <IFollowRequestRepository>();
            userRepository        = new Mock <IUserRepository>();
            userProfileRepository = new Mock <IUserProfileRepository>();


            unitOfWork = new Mock <IUnitOfWork>();

            controllerContext = new Mock <ControllerContext>();
            contextBase       = new Mock <HttpContextBase>();
            principal         = new Mock <IPrincipal>();
            identity          = new Mock <IIdentity>();
            httpRequest       = new Mock <HttpRequestBase>();
            httpResponse      = new Mock <HttpResponseBase>();
            genericPrincipal  = new Mock <GenericPrincipal>();

            groupInvitationService   = new GroupInvitationService(groupInvitationRepository.Object, unitOfWork.Object);
            supportInvitationService = new SupportInvitationService(supportInvitationRepository.Object, unitOfWork.Object);
            followRequestService     = new FollowRequestService(followRequestRepository.Object, unitOfWork.Object);
            userService = new UserService(userRepository.Object, unitOfWork.Object, userProfileRepository.Object);
        }
コード例 #7
0
        public void SetUp()
        {
            groupInvitationRepository = new Mock<IGroupInvitationRepository>();
            supportInvitationRepository = new Mock<ISupportInvitationRepository>();
            followRequestRepository = new Mock<IFollowRequestRepository>();
            userRepository = new Mock<IUserRepository>();
            userProfileRepository = new Mock<IUserProfileRepository>();


            unitOfWork = new Mock<IUnitOfWork>();

            controllerContext = new Mock<ControllerContext>();
            contextBase = new Mock<HttpContextBase>();
            principal = new Mock<IPrincipal>();
            identity = new Mock<IIdentity>();
            httpRequest = new Mock<HttpRequestBase>();
            httpResponse = new Mock<HttpResponseBase>();
            genericPrincipal = new Mock<GenericPrincipal>();

            groupInvitationService = new GroupInvitationService(groupInvitationRepository.Object, unitOfWork.Object);
            supportInvitationService = new SupportInvitationService(supportInvitationRepository.Object, unitOfWork.Object);
            followRequestService = new FollowRequestService(followRequestRepository.Object, unitOfWork.Object);
            userService = new UserService(userRepository.Object, unitOfWork.Object, userProfileRepository.Object);
        }
コード例 #8
0
ファイル: SupportService.cs プロジェクト: ckaeser/SocialGoal
        public IEnumerable <ApplicationUser> SearchUserToSupport(string searchString, int goalId, IUserService userService, ISupportInvitationService supportInvitationService, string userId)
        {
            var users = from u in userService.GetUsers(searchString)
                        where u.Id != userId && !(from g in GetSupporForGoal(goalId) select g.UserId).Contains(u.Id) &&
                        !(supportInvitationService.IsUserInvited(goalId, u.Id))
                        select u;

            return(users);
        }
コード例 #9
0
        public void SetUp()
        {
            goalRepository = new Mock<IGoalRepository>();
            followuserRepository = new Mock<IFollowUserRepository>();
            supportRepository = new Mock<ISupportRepository>();
            goalStatusRepository = new Mock<IGoalStatusRepository>();
            focusRepository = new Mock<IFocusRepository>();
            metricRepository = new Mock<IMetricRepository>();
            updateRepository = new Mock<IUpdateRepository>();
            userRepository = new Mock<IUserRepository>();
            supportrepository = new Mock<ISupportRepository>();
            supportInvitationrepository = new Mock<ISupportInvitationRepository>();
            commentRepository = new Mock<ICommentRepository>();
            commentUserRepository = new Mock<ICommentUserRepository>();
            securityTokenrepository = new Mock<ISecurityTokenRepository>();
            userProfileRepository = new Mock<IUserProfileRepository>();
            updateSupportRepository = new Mock<IUpdateSupportRepository>();

            userMailer = new Mock<IUserMailer>();
            userMailerMock = new Mock<UserMailer>();
            mailerBase = new Mock<MailerBase>();
            unitOfWork = new Mock<IUnitOfWork>();

            goalService = new GoalService(goalRepository.Object, followuserRepository.Object, unitOfWork.Object);
            supportService = new SupportService(supportRepository.Object, followuserRepository.Object, unitOfWork.Object);
            goalStatusService = new GoalStatusService(goalStatusRepository.Object, unitOfWork.Object);
            focusService = new FocusService(focusRepository.Object, unitOfWork.Object);
            metricService = new MetricService(metricRepository.Object, unitOfWork.Object);
            updateService = new UpdateService(updateRepository.Object, goalRepository.Object, unitOfWork.Object, followuserRepository.Object);
            userService = new UserService(userRepository.Object, unitOfWork.Object, userProfileRepository.Object);
            supportService = new SupportService(supportrepository.Object, followuserRepository.Object, unitOfWork.Object);
            supportInvitationService = new SupportInvitationService(supportInvitationrepository.Object, unitOfWork.Object);
            commentService = new CommentService(commentRepository.Object, commentUserRepository.Object, unitOfWork.Object, followuserRepository.Object);
            commentUserService = new CommentUserService(commentUserRepository.Object, userRepository.Object, unitOfWork.Object);
            securityTokenService = new SecurityTokenService(securityTokenrepository.Object, unitOfWork.Object);
            userProfileService = new UserProfileService(userProfileRepository.Object, unitOfWork.Object);
            updateSupportService = new UpdateSupportService(updateSupportRepository.Object, unitOfWork.Object);

            MailerBase.IsTestModeEnabled = true;
            userMailerMock.CallBase = true;

            controllerContext = new Mock<ControllerContext>();
            contextBase = new Mock<HttpContextBase>();
            httpRequest = new Mock<HttpRequestBase>();
            httpResponse = new Mock<HttpResponseBase>();
            genericPrincipal = new Mock<GenericPrincipal>();

            identity = new Mock<IIdentity>();
            principal = new Mock<IPrincipal>();
        }
コード例 #10
0
 public void CreateUserSupport(Support support, ISupportInvitationService supportInvitationService)
 {
     var oldUser = SupportRepository.GetMany(g => g.UserId == support.UserId && g.SupportId == support.SupportId);
     if (oldUser.Count() == 0)
     {
         SupportRepository.Add(support);
         SaveSupport();
     }
     supportInvitationService.AcceptInvitation(support.GoalId, support.UserId);
 }
コード例 #11
0
 public IEnumerable<ApplicationUser> SearchUserToSupport(string searchString, int goalId, IUserService userService, ISupportInvitationService supportInvitationService, string userId)
 {
     var users = from u in userService.GetUsers(searchString)
                 where u.Id != userId && !(from g in GetSupporForGoal(goalId) select g.UserId).Contains(u.Id) &&
                 !(supportInvitationService.IsUserInvited(goalId, u.Id))
                 select u;
     return users;
 }