예제 #1
0
        public void GivenAUserWallWhenPostsIsCalledThenItFiltersPostsForSpecifiedUser()
        {
            var userWall = new UserWall();
            var bob      = new User(BobUserHandle, userWall);
            var alice    = new User(AliceUserHandle, userWall);

            userWall.Post(bob, string.Format("{0} {1}", BobUserHandle, PostMessageText));
            userWall.Post(alice, string.Format("{0} {1}", AliceUserHandle, PostMessageText));

            userWall.Posts(bob).Should().OnlyContain(m => m.Body == string.Format("{0} {1}", BobUserHandle, PostMessageText));
        }
예제 #2
0
        public void GivenAUserWallWhenPostIsCalledThenItTimestampsTheMessage()
        {
            var userWall = new UserWall();
            var bob      = new User(BobUserHandle, userWall);

            userWall.Post(bob, PostMessageText);

            userWall.Posts(bob).Should().Contain(m => m.Timestamp == SystemTime.Now());
        }
예제 #3
0
        public void GivenAUserWallWhenPostIsCalledThenItSavesThePostMessage()
        {
            var userWall = new UserWall();
            var bob      = new User(BobUserHandle, userWall);

            userWall.Post(bob, PostMessageText);

            userWall.Posts(bob).Should().Contain(m => m.Body == PostMessageText);
        }