public void AddCastMember_Succesfully()
        {
            Task.Run(async() =>
            {
                CastMemberDTO mockCasMember_2 = new CastMemberDTO(2, "mockMember_2", "12-07-1989");

                await repo.AddCasts(mockCasMember_2);
                var cast = repo.GetAllTCast();
                Assert.IsTrue(cast.First().Id == mockCasMember_2.Id);
            }).GetAwaiter().GetResult();
        }
Esempio n. 2
0
        public async Task AddTVShows(IEnumerable <TVShowDTO> tvShows)
        {
            foreach (var tvShow in tvShows)
            {
                await tvShowRepository.AddTVShows(tvShow);

                foreach (var item in tvShow.Cast)
                {
                    await tvShowRepository.AddCasts(item);

                    TVShowCastMemberDTO relation = new TVShowCastMemberDTO(tvShow.Id, item.Id);
                    await tvShowRepository.AddRelation(relation);
                }
            }
        }