public async Task CreateReview_Should_Return_OkResult() { //Arrange var createReview = new Contracts.Reviews.V1.ReviewCreate { Id = ReviewId, Owner = OwnerId, Caption = "Test Review", Content = "This is awesome product... You should buy it!" }; outputHelper.WriteLine("ReviewId:" + ReviewId.ToString()); //Act var response = await client.PostAsJsonAsync("/reviews", createReview); var payload = await response.Content.ReadAsStringAsync(); outputHelper.WriteLine(payload); // Assert response.EnsureSuccessStatusCode(); Assert.Equal(HttpStatusCode.OK, response.StatusCode); }
public Task Handle(Contracts.Reviews.V1.ReviewCreate command) => aggrigateStore.Save(Domain.Review.Create(command.Id, command.Owner, command.Caption, command.Content));
public Task <IActionResult> Post(Contracts.Reviews.V1.ReviewCreate command) => HandleOrThrow(command, app => applicationService.Handle(app));
public Task Handle(Contracts.Reviews.V1.ReviewCreate command) => repository.SaveAsync(Domain.Review.Create(command.Id, command.Owner, command.ProductId, command.Caption, command.Content));