Exemplo n.º 1
0
        // ReSharper disable once InconsistentNaming
        public async Task GetEpisodeById_should_return_null_if_episode_does_not_exist()
        {
            using (var context = CreateContext())
            {
                await SeedEpisodesAsync(context);

                var repository = new EpisodeRepository(context);

                int id = 42;

                var episode = await repository.GetEpisodeById(id);

                Assert.Null(episode);
            }
        }
Exemplo n.º 2
0
        // ReSharper disable once InconsistentNaming
        public async Task GetEpisodeById_should_return_episode_by_id()
        {
            using (var context = CreateContext())
            {
                await SeedEpisodesAsync(context);

                var repository = new EpisodeRepository(context);

                int id = 2;

                var episode = await repository.GetEpisodeById(id);

                Assert.Equal(id, episode.Id);
            }
        }