public async Task DeleteEpisodeAsyncWorksCorrectly()
        {
            var episodes = new List <Episode>();
            var episode  = new Episode()
            {
                Webtoon = new Webtoon()
                {
                    AuthorId = "test"
                }
            };

            episodes.Add(episode);
            var mockEpisodesRepo = new Mock <IEpisodesRepository>();

            mockEpisodesRepo.Setup(x => x.GetEpisodeByWebtoonTitleNumberAndEpisodeNumber("smt", "smtelse")).Returns(episodes.FirstOrDefault());
            mockEpisodesRepo.Setup(x => x.Delete(It.IsAny <Episode>())).Callback((Episode episode) => episode.IsDeleted = true);
            var mockWebtoonsRepo = new Mock <IWebtoonsRepository>();
            var webtoon          = new Webtoon()
            {
                TitleNumber = "123",
                AuthorId    = "test"
            };

            mockWebtoonsRepo.Setup(x => x.GetWebtoonByTitleNumber("smt")).Returns(webtoon);

            var service = new EpisodesService(mockWebtoonsRepo.Object, mockEpisodesRepo.Object, null, null, null, null, null, null);

            await service.DeleteEpisodeAsync("smt", "smtelse", "test");

            Assert.Single(episodes);
            Assert.True(episode.IsDeleted);
        }
        public async Task DeleteEpisodeAsyncThrowsNullExceptionWhenAuthorIdIsInvalid()
        {
            var episodes = new List <Episode>();
            var episode  = new Episode()
            {
                Webtoon = new Webtoon()
                {
                    AuthorId = "test"
                }
            };

            episodes.Add(episode);
            var mockEpisodesRepo = new Mock <IEpisodesRepository>();

            mockEpisodesRepo.Setup(x => x.GetEpisodeByWebtoonTitleNumberAndEpisodeNumber("smt", "smtelse")).Returns(episodes.FirstOrDefault());
            var mockWebtoonsRepo = new Mock <IWebtoonsRepository>();
            var webtoon          = new Webtoon()
            {
                TitleNumber = "123",
                AuthorId    = "test"
            };

            mockWebtoonsRepo.Setup(x => x.GetWebtoonByTitleNumber("smt")).Returns(webtoon);

            var service = new EpisodesService(mockWebtoonsRepo.Object, mockEpisodesRepo.Object, null, null, null, null, null, null);

            await Assert.ThrowsAsync <ArgumentNullException>(() => service.DeleteEpisodeAsync("smt", "smtelse", "user"));
        }