Ejemplo n.º 1
0
 public UserController(UserService userService, PostService postService, WallService wallService)
 {
     _userService = userService;
     _postService = postService;
     _wallService = wallService;
     _vm          = new UserViewModel();
 }
Ejemplo n.º 2
0
 public void UserServiceConstructorTest()
 {
     db          = new FelBookDBEntities();
     wallServ    = new WallService(db);
     userService = new UserService(db, wallServ);
     Assert.IsNotNull(userService);
 }
 public CircleController(CircleService circleService, UserService userService, WallService wallService, PostService postService)
 {
     _postService   = postService;
     _wallService   = wallService;
     _circleService = circleService;
     _userService   = userService;
 }
Ejemplo n.º 4
0
 public UserController(WallService wallService, UserService userService, GroupService groupService, BlogService blogService, StoreService storeService)
 {
     this.wallService  = wallService;
     this.userService  = userService;
     this.groupService = groupService;
     this.blogService  = blogService;
     this.storeService = storeService;
 }
Ejemplo n.º 5
0
        public void GroupServiceConstructorTest()
        {
            FelBookDBEntities DBEntities  = new FelBookDBEntities();
            IWallService      wallService = new WallService(DBEntities);
            GroupService      target      = new GroupService(DBEntities, wallService);

            Assert.IsNotNull(target);
        }
Ejemplo n.º 6
0
        public void TestInitializer()
        {
            _uow = Substitute.For <IUnitOfWork2>();

            _wallsDbSet         = _uow.MockDbSet <Wall>();
            _wallModeratorDbSet = _uow.MockDbSet <WallModerator>();
            _wallUsersDbSet     = _uow.MockDbSet <WallMember>();
            _usersDbSet         = _uow.MockDbSet <ApplicationUser>();

            _permissionService = Substitute.For <IPermissionService>();
            var roleService = Substitute.For <IRoleService>();

            MockRoleService(roleService);

            _wallService = new WallService(ModelMapper.Create(), _uow, _permissionService);
        }
Ejemplo n.º 7
0
 public void SubscribeUnsubscribe()
 {
     if (!this.IsSubscribed)
     {
         WallService.Current.WallSubscriptionsSubscribe(-this._gid, (Action <BackendResult <ResponseWithId, ResultCode> >)(res =>
         {
             GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.NewsPostsNotificationsAreEnabled, (VKRequestsDispatcher.Error)null);
             if (res.ResultCode != ResultCode.Succeeded || this._group == null)
             {
                 return;
             }
             this._group.IsSubscribed = !this._group.IsSubscribed;
             this.NotifyPropertyChanged <bool>((() => this.IsSubscribed));
             EventAggregator current = EventAggregator.Current;
             GroupSubscribedUnsubscribedEvent unsubscribedEvent = new GroupSubscribedUnsubscribedEvent();
             unsubscribedEvent.group = this._group;
             int num = this.IsSubscribed ? 1 : 0;
             unsubscribedEvent.IsSubscribed = num != 0;
             current.Publish(unsubscribedEvent);
         }));
     }
     else
     {
         WallService current1 = WallService.Current;
         List <long> ownerIds = new List <long>();
         ownerIds.Add(-this._gid);
         Action <BackendResult <ResponseWithId, ResultCode> > callback = (Action <BackendResult <ResponseWithId, ResultCode> >)(res =>
         {
             GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.NewsPostsNotificationsAreDisabled, (VKRequestsDispatcher.Error)null);
             if (res.ResultCode != ResultCode.Succeeded || this._group == null)
             {
                 return;
             }
             this._group.IsSubscribed = !this._group.IsSubscribed;
             this.NotifyPropertyChanged <bool>((() => this.IsSubscribed));
             EventAggregator current = EventAggregator.Current;
             GroupSubscribedUnsubscribedEvent unsubscribedEvent = new GroupSubscribedUnsubscribedEvent();
             unsubscribedEvent.group = this._group;
             int num = this.IsSubscribed ? 1 : 0;
             unsubscribedEvent.IsSubscribed = num != 0;
             current.Publish(unsubscribedEvent);
         });
         current1.WallSubscriptionsUnsubscribe(ownerIds, callback);
     }
 }
Ejemplo n.º 8
0
 public void Share(string text, long gid = 0, string groupName = "")
 {
     if (!this._isGif)
     {
         WallService.Current.Repost(this._ownerId, this._picId, text, RepostObject.photo, gid, (Action <BackendResult <RepostResult, ResultCode> >)(res => Execute.ExecuteOnUIThread((Action)(() =>
         {
             if (res.ResultCode == ResultCode.Succeeded)
             {
                 GenericInfoUC.ShowPublishResult(GenericInfoUC.PublishedObj.Photo, gid, groupName);
             }
             else
             {
                 new GenericInfoUC().ShowAndHideLater(CommonResources.Error, (FrameworkElement)null);
             }
         }))));
     }
     else
     {
         string              str      = string.IsNullOrWhiteSpace(this._accessKey) ? string.Format("doc{0}_{1}", (object)this._ownerId, (object)this._picId) : string.Format("doc{0}_{1}_{2}", (object)this._ownerId, (object)this._picId, (object)this._accessKey);
         WallService         current  = WallService.Current;
         WallPostRequestData postData = new WallPostRequestData();
         postData.owner_id      = -gid;
         postData.message       = text;
         postData.AttachmentIds = new List <string>()
         {
             str
         };
         Action <BackendResult <ResponseWithId, ResultCode> > callback = (Action <BackendResult <ResponseWithId, ResultCode> >)(res => Execute.ExecuteOnUIThread((Action)(() =>
         {
             if (res.ResultCode == ResultCode.Succeeded)
             {
                 GenericInfoUC.ShowPublishResult(GenericInfoUC.PublishedObj.Doc, gid, groupName);
             }
             else
             {
                 new GenericInfoUC().ShowAndHideLater(CommonResources.Error, (FrameworkElement)null);
             }
         })));
         current.Post(postData, callback);
     }
 }
Ejemplo n.º 9
0
 public void Share(string text, long gid = 0, string groupName = "")
 {
     if (!this.IsGif)
     {
         WallService.Current.Repost(this._ownerId, this._pid, text, RepostObject.photo, gid, (Action <BackendResult <RepostResult, ResultCode> >)(res => Execute.ExecuteOnUIThread((Action)(() =>
         {
             if (res.ResultCode == ResultCode.Succeeded)
             {
                 GenericInfoUC.ShowPublishResult(GenericInfoUC.PublishedObj.Photo, gid, groupName);
             }
             else
             {
                 new GenericInfoUC().ShowAndHideLater(CommonResources.Error, null);
             }
         }))));
     }
     else
     {
         WallService         current  = WallService.Current;
         WallPostRequestData postData = new WallPostRequestData();
         postData.owner_id      = gid > 0L ? -gid : AppGlobalStateManager.Current.LoggedInUserId;
         postData.message       = text;
         postData.AttachmentIds = new List <string>()
         {
             this._doc.UniqueIdForAttachment
         };
         Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> > callback = (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => Execute.ExecuteOnUIThread((Action)(() =>
         {
             if (res.ResultCode == ResultCode.Succeeded)
             {
                 GenericInfoUC.ShowPublishResult(GenericInfoUC.PublishedObj.Doc, gid, groupName);
             }
             else
             {
                 new GenericInfoUC().ShowAndHideLater(CommonResources.Error, null);
             }
         })));
         current.Post(postData, callback);
     }
 }
Ejemplo n.º 10
0
        public void Init()
        {
            db.ExecuteStoreCommand("DELETE FROM WallItemSet");

            service = new WallService(db);

            user1 = new User {
                Username = "******" + db.UserSet.Count(),
                Mail     = "*****@*****.**",
                Name     = "John",
                Surname  = "Doe",
            };
            user1.ChangePassword("123456");
            db.UserSet.AddObject(user1);

            status1 = new Status {
                User    = user1,
                Text    = "Status",
                Created = DateTime.Now,
            };
            db.StatusSet.AddObject(status1);
        }
Ejemplo n.º 11
0
 public WallController(WallService wallService)
 {
     _wallService = wallService;
 }
Ejemplo n.º 12
0
 public GroupController(GroupService groupService, WallService wallService, UserService userService)
 {
     this.groupService = groupService;
     this.wallService  = wallService;
     this.userService  = userService;
 }
Ejemplo n.º 13
0
 public WallController(IHttpContextAccessor httpContextAccessor, AccountService accountService, DialogService dialogService, FileService fileService, ProfileService profileService, RelationshipService relationshipService, WallService wallService) : base(httpContextAccessor, accountService, dialogService, fileService, profileService, relationshipService, wallService)
 {
 }
Ejemplo n.º 14
0
 public SearchController(UserService userService, WallService wallService)
 {
     this.userService = userService;
     this.wallService = wallService;
 }
Ejemplo n.º 15
0
 public PostController(PostService postService, UserService userService, WallService wallService)
 {
     _postService = postService;
     _userService = userService;
     _wallService = wallService;
 }
Ejemplo n.º 16
0
 public WallController(WallService service, PostService pservice)
 {
     _wallService = service;
     _postService = pservice;
 }
Ejemplo n.º 17
0
 public VcksController(IHttpContextAccessor httpContextAccessor, AccountService accountService, DialogService dialogService, FileService fileService, ProfileService profileService, RelationshipService relationshipService, WallService wallService)
 {
     this.httpContextAccessor = httpContextAccessor;
     this.accountService      = accountService;
     this.dialogService       = dialogService;
     this.fileService         = fileService;
     this.profileService      = profileService;
     this.relationshipService = relationshipService;
     this.wallService         = wallService;
 }
Ejemplo n.º 18
0
 public Wall(WallService wallService)
 {
     this.wallService = wallService;
 }
Ejemplo n.º 19
0
 public WallController(WallService wallService, UserService userService)
 {
     _wallService = wallService;
     _userService = userService;
 }
Ejemplo n.º 20
0
 public UserServiceTest()
 {
     db          = new FelBookDBEntities();
     wallServ    = new WallService(db);
     userService = new UserService(db, wallServ);
 }