public async Task GetPostById_Should_Return_200() { var response = await HttpClient.GetAsync(MovieRoutes.GetMovieById(TestConstants.GetMovieId())); GetMovieResponseViewModel responseModel = await response.Content.GetAsync <GetMovieResponseViewModel>(); Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal(responseModel.MovieId, TestConstants.GetMovieId()); }
public async Task CommentMovie_Should_Return_400() { CommentMovieRequestModel model = new CommentMovieRequestModel { MovieId = TestConstants.GetMovieId() }; var response = await HttpClient.PostAsync(MovieRoutes.CommentMovie(), model); Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); }
public void Seed(AmazonDynamoDBClient client) { MovieEntity model = new MovieEntity { MovieId = TestConstants.GetMovieId(), DirectorId = TestConstants.GetDirectorId(), MovieName = TestConstants.GetMovieName(), CreateDate = DateTime.UtcNow.ToComparableDateString() }; DynamoDbSeeder.Add(client, model); }
public async Task CommentMovie_Should_Return_200() { CommentMovieRequestModel model = new CommentMovieRequestModel { MovieId = TestConstants.GetMovieId(), Comment = "Great Movie!" }; var response = await HttpClient.PostAsync(MovieRoutes.CommentMovie(), model); Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.True(await IsItemInQueueAsync(TestConstants.GetMovieId())); }