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>(); }
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() }); }
public void Test_PersonMovieCreditsRequest_Returns_Valid_RequestObjectType() { var request = new PersonMovieCreditsRequest(); request.RequestObjectType.Should().Be(RequestObjectType.People); }
public void Test_PersonMovieCreditsRequest_Has_Valid_UriTemplate() { var request = new PersonMovieCreditsRequest(); request.UriTemplate.Should().Be("people/{id}/movies{?extended}"); }
public void Test_PersonMovieCreditsRequest_Has_AuthorizationRequirement_NotRequired() { var request = new PersonMovieCreditsRequest(); request.AuthorizationRequirement.Should().Be(AuthorizationRequirement.NotRequired); }