public async Task FindByIdAync_MillaJovovich_Returns_ExpectedValues()
        {
            const string expectedName         = "Milla Jovovich";
            const string expectedBiography    = "Milla Jovovich, born as Milica Natasha Jovovich, is an Ukrainian-born actress, an American supermodel, musician, and fashion designer."; // truncated
            DateTime     expectedBirthday     = DateTime.Parse("1975-12-17");
            const Gender expectedGender       = Gender.Female;
            const string expectedHomepage     = "http://www.millaj.com";
            const string expectedImdbId       = "nm0000170";
            const string expectedPlaceOfBirth = "Kiev, Ukraine";

            ApiQueryResponse <Person> response = await _api.FindByIdAsync(PersonId_MillaJovovich);

            ApiResponseUtil.AssertErrorIsNull(response);

            Person person = response.Item;

            Assert.AreEqual(expectedName, person.Name);
            Assert.IsTrue(person.Biography.StartsWith(expectedBiography));
            Assert.IsFalse(person.IsAdultFilmStar);
            Assert.AreEqual(0, person.AlsoKnownAs.Count);
            Assert.AreEqual(expectedBirthday, person.Birthday);
            Assert.AreEqual(expectedGender, person.Gender);
            Assert.AreEqual(null, person.Deathday);
            Assert.AreEqual(expectedHomepage, person.Homepage);
            Assert.AreEqual(expectedImdbId, person.ImdbId);
            Assert.AreEqual(expectedPlaceOfBirth, person.PlaceOfBirth);
            Assert.IsTrue(person.Popularity > 10);
            Assert.IsNotNull(person.ProfilePath);
        }
Example #2
0
        public async Task GetCastMembers(MovieDetail movie)
        {
            for (int i = 0; i < movie.cast.Count; i++)
            {
                ApiQueryResponse <Person> castDetail = await _pApi.FindByIdAsync(movie.cast[i].id);

                if (castDetail.Item != null)
                {
                    movie.cast[i].posterPath = castDetail.Item.ProfilePath;
                }
            }
        }