public async Task <CreateComment_TestHarness> Build() { var feedCommand = new CreateFeedCommand { Description = "Some feed", Name = "Some feed" }; var feedId = await SendAsync(feedCommand); var postCommand = new CreatePostCommand { Text = "Some post", FeedId = feedId }; var createPostCommandResponse = await SendAsync(postCommand); _command = new CreateCommentCommand { Text = _commentText, PostId = createPostCommandResponse.PostId.Value }; var commentId = await SendAsync(_command); _comment = await FindAsync <Comment>(commentId); return(this); }
public void ShouldRequireMinimumFields() { var command = new CreateFeedCommand(); FluentActions.Invoking(() => SendAsync(command)).Should().Throw <ValidationException>(); }
public async Task <CreateFeed_TestHarness> Build() { _command = new CreateFeedCommand { Name = _name }; var feedId = await SendAsync(_command); _feed = await FindAsync <Feed>(feedId); return(this); }
public async Task <CreatePost_TestHarness> Build() { var feedCommand = new CreateFeedCommand { Description = "Some feed", Name = "Some feed" }; var feedId = await SendAsync(feedCommand); _command = new CreatePostCommand { Text = _postText, FeedId = feedId }; var createPostCommandResponse = await SendAsync(_command); _post = await FindAsync <Post>(createPostCommandResponse.PostId.Value); return(this); }
public async Task <ActionResult <Guid> > Create(CreateFeedCommand command) { return(await Mediator.Send(command)); }