示例#1
0
        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());
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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()));
        }