public async Task <IActionResult> AddRating([FromRoute] string movie, AddRating command) { await _repository.AddRating(movie, command.User, command.Stars); await _hubContext.Clients.Group(movie).NewRatingArrived(command); return(Ok()); }
public async Task GivenLastJedi_WhenAddReview_ThenReviewAndMovieGotAdded() { GivenYesterdaysJam(); var sut = new ReviewRepository(_documentStore); await sut.AddRating(MovieId, "me", 3); using var session = _documentStore.LightweightSession(); var reviews = await session.LoadAsync <Review>(MovieId); var rating = reviews.Ratings.First(); Assert.Equal(3, rating.Stars); Assert.Equal("me", rating.User); }