Ejemplo n.º 1
0
 public HandlerContext(IClock clock, IDataStore dataStore, User currentUser)
 {
     Clock = clock;
     DataStore = dataStore;
     CurrentUser = currentUser;
 }
Ejemplo 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();
        }