Exemple #1
0
        private IEnumerable<string> GetTimeline(TimelineCommand timelineCommand)
        {
            var posts = _postStore.GetPostsByUser(timelineCommand.User);

            return posts
                .OrderByDescending(p => p.Date)
                .Select(_postFormatter.FormatAsTimelineEntry)
                .ToList();
        }
        public void CreateFrom_GivenATimelineCommand_RecognizesItCorrectly()
        {
            // arrange
            var user = Alice;
            var timelineCommand = $"{user}";

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

            // assert
            var expectedCommand = new TimelineCommand(user);
            command.Should().Be(expectedCommand);
        }