Exemplo n.º 1
0
        public List<Post> GetWallPosts(string forUserName, string viewerUserName)
        {
            var currentUser = GetUser(viewerUserName);

            var context = new HandlerContext(Clock, Store, currentUser);

            var handler = new GetWall.Handler(context);

            var response = handler.Handle(new GetWall.Request { UserName = forUserName });

            return response.Posts;
        }
Exemplo n.º 2
0
        public void When_USERNAME_CreatesAPostSharedWith_SCOPE(string userName, PrivacyScope scope)
        {
            var currentUser = GetUser(userName);

            var request = Fixture
                .Build<SubmitPost.Request>()
                .With(r => r.Scope, scope)
                .Create();

            var context = new HandlerContext(Clock, Store, currentUser);

            var handler = new SubmitPost.Handler(context);

            handler.Handle(request);

            _lastUserToCreatePost = currentUser;

            _lastCreatedPost = Store.Select<Post>().OrderByDescending(p => p.PublishedDate).First();
        }