public void CreateFrom_GivenAWallCommand_RecognizesItCorrectly()
        {
            // arrange
            var user = Charlie;
            var wallCommand = $"{user} wall";

            // act
            var command = CommandFactory.CreateFrom(wallCommand);

            // assert
            var expectedCommand = new WallCommand(user);
            command.Should().Be(expectedCommand);
        }
Exemple #2
0
        private IEnumerable<string> Wall(WallCommand wallCommand)
        {
            var followed = _followStore.GetFollowedBy(wallCommand.User);
            var users = followed.Concat(new[] {wallCommand.User});

            return _postStore
                .GetPostsByUsers(users)
                .OrderByDescending(x => x.Date)
                .Select(_postFormatter.FormatAsWallEntry)
                .ToList();
        }