예제 #1
0
        public void Test_MovieCommentsRequest_Validate_Throws_Exceptions()
        {
            // id is null
            var request = new MovieCommentsRequest();

            Action act = () => request.Validate();

            act.Should().Throw <ArgumentNullException>();

            // empty id
            request = new MovieCommentsRequest {
                Id = string.Empty
            };

            act = () => request.Validate();
            act.Should().Throw <ArgumentException>();

            // id with spaces
            request = new MovieCommentsRequest {
                Id = "invalid id"
            };

            act = () => request.Validate();
            act.Should().Throw <ArgumentException>();
        }
예제 #2
0
        public async Task <ICommentsResponse> GetMovieComments(long movieId)
        {
            var request = new MovieCommentsRequest();

            request.Lang    = _culture;
            request.MovieId = movieId;

            var res = await request.ExecuteAsync();

            return(res);
        }
예제 #3
0
        public void Test_MovieCommentsRequest_Has_Valid_UriTemplate()
        {
            var request = new MovieCommentsRequest();

            request.UriTemplate.Should().Be("movies/{id}/comments{/sort_order}{?page,limit}");
        }