예제 #1
0
        public async Task Test_TraktCertificationsModule_GetShowCertifications()
        {
            TraktClient client = TestUtility.GetMockClient(GET_SHOW_CERTIFICATIONS_URI, GET_SHOW_CERTIFICATIONS_JSON);
            TraktResponse <ITraktCertifications> response = await client.Certifications.GetShowCertificationsAsync();

            response.Should().NotBeNull();
            response.IsSuccess.Should().BeTrue();
            response.Value.Should().NotBeNull();
            response.HasValue.Should().BeTrue();
            response.Exception.Should().BeNull();

            ITraktCertifications certifications = response.Value;

            certifications.US.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(7);

            ITraktCertification[] certificationsUS = certifications.US.ToArray();

            certificationsUS[0].Should().NotBeNull();
            certificationsUS[0].Name.Should().Be("TV-Y");
            certificationsUS[0].Slug.Should().Be("tv-y");
            certificationsUS[0].Description.Should().Be("All Children");

            certificationsUS[1].Should().NotBeNull();
            certificationsUS[1].Name.Should().Be("TV-Y7");
            certificationsUS[1].Slug.Should().Be("tv-y7");
            certificationsUS[1].Description.Should().Be("Older Children - Ages 7+ Recommended");

            certificationsUS[2].Should().NotBeNull();
            certificationsUS[2].Name.Should().Be("TV-G");
            certificationsUS[2].Slug.Should().Be("tv-g");
            certificationsUS[2].Description.Should().Be("All Ages");

            certificationsUS[3].Should().NotBeNull();
            certificationsUS[3].Name.Should().Be("TV-PG");
            certificationsUS[3].Slug.Should().Be("tv-pg");
            certificationsUS[3].Description.Should().Be("Parental Guidance Suggested");

            certificationsUS[4].Should().NotBeNull();
            certificationsUS[4].Name.Should().Be("TV-14");
            certificationsUS[4].Slug.Should().Be("tv-14");
            certificationsUS[4].Description.Should().Be("Parents Strongly Cautioned - Ages 14+ Recommended");

            certificationsUS[5].Should().NotBeNull();
            certificationsUS[5].Name.Should().Be("TV-MA");
            certificationsUS[5].Slug.Should().Be("tv-ma");
            certificationsUS[5].Description.Should().Be("tv-ma");

            certificationsUS[6].Should().NotBeNull();
            certificationsUS[6].Name.Should().Be("Not Rated");
            certificationsUS[6].Slug.Should().Be("nr");
            certificationsUS[6].Description.Should().Be("Not Rated");
        }
        public async Task Test_TraktCertificationsModule_GetMovieCertifications()
        {
            TraktClient client = TestUtility.GetMockClient(GET_MOVIE_CERTIFICATIONS_URI, GET_MOVIE_CERTIFICATIONS_JSON);
            TraktResponse <ITraktCertifications> response = await client.Certifications.GetMovieCertificationsAsync();

            response.Should().NotBeNull();
            response.IsSuccess.Should().BeTrue();
            response.Value.Should().NotBeNull();
            response.HasValue.Should().BeTrue();
            response.Exception.Should().BeNull();

            ITraktCertifications certifications = response.Value;

            certifications.US.Should().NotBeNull().And.NotBeEmpty().And.HaveCount(5);

            ITraktCertification[] certificationsUS = certifications.US.ToArray();

            certificationsUS[0].Should().NotBeNull();
            certificationsUS[0].Name.Should().Be("G");
            certificationsUS[0].Slug.Should().Be("g");
            certificationsUS[0].Description.Should().Be("All Ages");

            certificationsUS[1].Should().NotBeNull();
            certificationsUS[1].Name.Should().Be("PG");
            certificationsUS[1].Slug.Should().Be("pg");
            certificationsUS[1].Description.Should().Be("Parental Guidance Suggested");

            certificationsUS[2].Should().NotBeNull();
            certificationsUS[2].Name.Should().Be("PG-13");
            certificationsUS[2].Slug.Should().Be("pg-13");
            certificationsUS[2].Description.Should().Be("Parents Strongly Cautioned - Ages 13+ Recommended");

            certificationsUS[3].Should().NotBeNull();
            certificationsUS[3].Name.Should().Be("R");
            certificationsUS[3].Slug.Should().Be("r");
            certificationsUS[3].Description.Should().Be("Mature Audiences - Ages 17+ Recommended");

            certificationsUS[4].Should().NotBeNull();
            certificationsUS[4].Name.Should().Be("Not Rated");
            certificationsUS[4].Slug.Should().Be("nr");
            certificationsUS[4].Description.Should().Be("Not Rated");
        }