Exemple #1
0
        public void Test_PersonMovieCreditsRequest_Validate_Throws_Exceptions()
        {
            // id is null
            var request = new PersonMovieCreditsRequest();

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

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

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

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

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

            act = () => request.Validate();
            act.Should().Throw <ArgumentException>();
        }
Exemple #2
0
        public void Test_PersonMovieCreditsRequest_Returns_Valid_UriPathParameters()
        {
            // only id
            var request = new PersonMovieCreditsRequest {
                Id = "123"
            };

            request.GetUriPathParameters().Should().NotBeNull()
            .And.HaveCount(1)
            .And.Contain(new Dictionary <string, object>
            {
                ["id"] = "123"
            });

            // id and extended info
            var extendedInfo = new TraktExtendedInfo {
                Full = true
            };

            request = new PersonMovieCreditsRequest {
                Id = "123", ExtendedInfo = extendedInfo
            };

            request.GetUriPathParameters().Should().NotBeNull()
            .And.HaveCount(2)
            .And.Contain(new Dictionary <string, object>
            {
                ["id"]       = "123",
                ["extended"] = extendedInfo.ToString()
            });
        }
Exemple #3
0
        public void Test_PersonMovieCreditsRequest_Returns_Valid_RequestObjectType()
        {
            var request = new PersonMovieCreditsRequest();

            request.RequestObjectType.Should().Be(RequestObjectType.People);
        }
Exemple #4
0
        public void Test_PersonMovieCreditsRequest_Has_Valid_UriTemplate()
        {
            var request = new PersonMovieCreditsRequest();

            request.UriTemplate.Should().Be("people/{id}/movies{?extended}");
        }
Exemple #5
0
        public void Test_PersonMovieCreditsRequest_Has_AuthorizationRequirement_NotRequired()
        {
            var request = new PersonMovieCreditsRequest();

            request.AuthorizationRequirement.Should().Be(AuthorizationRequirement.NotRequired);
        }