internal static Book Create(ICreateBookMessage message) { var book = new Book { Title = message.Title, Description = message.Description, Author = message.Author, Published = message.Published != null ? message.Published.Value : DateTime.Now, CoverSource = message.CoverSource }; if(!string.IsNullOrEmpty(message.Tags)) book.Tags = message.Tags.Split(new []{','}, StringSplitOptions.RemoveEmptyEntries); return book; }
private TestableBookCommand GetCommandWithSession(ICreateBookMessage message) { var command = new TestableBookCommand(message); command.Session = sessionMock.Object; return command; }
public TestableBookCommand(ICreateBookMessage message) : base(message) { }