コード例 #1
0
        // ReSharper disable once InconsistentNaming
        public async Task GetEpisodesByTheTvDbIdsAsync_should_return_empty_array_when_called_with_empty_array()
        {
            using (var context = CreateContext())
            {
                await SeedEpisodesAsync(context);

                var repository = new EpisodeRepository(context);

                var episodes = await repository.GetEpisodesByTheTvDbIdsAsync(Array.Empty<int>());

                Assert.Equal(0, episodes.Length);
            }
        }
コード例 #2
0
        // ReSharper disable once InconsistentNaming
        public async Task GetEpisodesByTheTvDbIdsAsync_should_return_episodes_with_mathing_ids()
        {
            using (var context = CreateContext())
            {
                await SeedEpisodesAsync(context);

                var repository = new EpisodeRepository(context);

                int[] ids = {
                    10,
                    20,
                    30
                };

                var episodes = await repository.GetEpisodesByTheTvDbIdsAsync(ids);

                Assert.Equal(ids.Length, episodes.Length);

                for (int i = 0; i < episodes.Length; i++)
                {
                    Assert.Equal(ids[i], episodes[i].TheTvDbId);
                }
            }
        }