コード例 #1
0
ファイル: SocApp.cs プロジェクト: hiredgunhouse/SocNet
        private IEnumerable<string> GetTimeline(TimelineCommand timelineCommand)
        {
            var posts = _postStore.GetPostsByUser(timelineCommand.User);

            return posts
                .OrderByDescending(p => p.Date)
                .Select(_postFormatter.FormatAsTimelineEntry)
                .ToList();
        }
コード例 #2
0
        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);
        }